Added ComputeMeshVolume to the Stat<> class
This commit is contained in:
parent
e8c27766a7
commit
ceaa1c7ffb
|
@ -33,6 +33,7 @@
|
||||||
#include <vcg/complex/algorithms/closest.h>
|
#include <vcg/complex/algorithms/closest.h>
|
||||||
#include <vcg/space/index/grid_static_ptr.h>
|
#include <vcg/space/index/grid_static_ptr.h>
|
||||||
#include <vcg/complex/algorithms/update/topology.h>
|
#include <vcg/complex/algorithms/update/topology.h>
|
||||||
|
#include <vcg/complex/algorithms/inertia.h>
|
||||||
|
|
||||||
|
|
||||||
namespace vcg {
|
namespace vcg {
|
||||||
|
@ -163,6 +164,11 @@ public:
|
||||||
return barycenter/areaSum;
|
return barycenter/areaSum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static ScalarType ComputeMeshVolume(MeshType & m)
|
||||||
|
{
|
||||||
|
Inertia<MeshType> I(m);
|
||||||
|
return I.Mass();
|
||||||
|
}
|
||||||
|
|
||||||
static ScalarType ComputeMeshArea(MeshType & m)
|
static ScalarType ComputeMeshArea(MeshType & m)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue