I have a list of points of a convex polyhedron for which I need to compute the eigenvectors of the Moment of Inertia matrix. But, it seems like the built-in MomentOfInertia
behave very differently for ConvexHullMesh
and ConvexHullRegion
pts3 = {{0.9000000000000000222`8., 0.4500000000000000111`8., 0.5`8.}, {0.6750000000000000444`8., 0.8397114317029974462`8., 0.5`8.}, {0.2250000000000000056`8., 0.8397114317029974462`8., 0.5`8.}, {0, 0.4500000000000000111`8., 0.5`8.}, {0.2250000000000000056`8., 0.060288568297002243`8., 0.5`8.}, {0.6750000000000000444`8., 0.060288568297002243`8., 0.5`8.}, {0.9000000000000000222`8., 0.4500000000000000111`8., 0.1`8.}, {0.6750000000000000444`8., 0.060288568297002243`8., 0.1`8.}, {0.2250000000000000056`8., 0.060288568297002243`8., 0.1`8.}, {0, 0.4500000000000000111`8.,0.1`8.}, {0.2250000000000000056`8., 0.8397114317029974462`8., 0.1`8.}, {0.6750000000000000444`8., 0.8397114317029974462`8., 0.1`8.}};
(*plotting function*)
plt[region_, eigvec_, cent_] := Show[region,Graphics3D[{{Green, Thick, InfiniteLine[cent, #] &/@ eigvec},
{Opacity[0.4], Red, Hyperplane[#, cent] & /@ eigvec}}, ImageSize -> Small]]
(*using convexhullmesh *)
reg1 = ConvexHullMesh[pts3];
cent1 = RegionCentroid@reg1;
{eigval1, eigvec1} = Eigensystem@MomentOfInertia@reg1;
plt[reg1, eigvec1, cent1]
(*using convexhullregion*)
reg2 = ConvexHullRegion[pts3];
cent2 = RegionCentroid@reg2;
{eigval2, eigvec2} = Eigensystem@MomentOfInertia@reg2;
plt[Region@reg2, eigvec2, cent2]
Observe the orientation of the cutting planes; they look very different for the two cases. I think I can use DiscretizeRegion@ConvexHullMesh[pts3]
to make the cutting planes in the first case to look like the latter. However, I am confused as to why MomentOfInertia
is behaving differently in the two cases? Is this a bug?
RootApproximant[N[pts3]]
. $\endgroup$