From ceaa1c7ffbe0b80f06982a2a00fee3af969f547c Mon Sep 17 00:00:00 2001 From: cignoni Date: Sat, 30 Jan 2016 23:09:05 +0000 Subject: [PATCH] Added ComputeMeshVolume to the Stat<> class --- vcg/complex/algorithms/stat.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vcg/complex/algorithms/stat.h b/vcg/complex/algorithms/stat.h index 75a0ba50..3424bc6a 100644 --- a/vcg/complex/algorithms/stat.h +++ b/vcg/complex/algorithms/stat.h @@ -33,6 +33,7 @@ #include #include #include +#include namespace vcg { @@ -163,6 +164,11 @@ public: return barycenter/areaSum; } + static ScalarType ComputeMeshVolume(MeshType & m) + { + Inertia I(m); + return I.Mass(); + } static ScalarType ComputeMeshArea(MeshType & m) {