I’m trying to make an STL analysis program for which I need to calculate the axis of minimum moment of inertia. The program so far can calculate the centre of mass and aligns the object such that its centre of mass is at the origin.
As some of you may know an STL is essentially a surface skin for which the assumption is placed that the enclosed volume is homogeneous (at least in my case). In a manner of speaking the data of an STL stores a model in the form of sets of three points which then can be used to produce a triangle, a large number of which are put together to make the complete surface. I exploited this fact when calculating the centre of mass by using the origin of the original file (which was likely not the centre of mass) as a fourth point for each set of three points, then calculating the volume using the scalar triple product as follows for each triangular face.
![]()
Which was then eventually used to calculate the true centre of mass for the entire object and this seems to work well.
This is a pretty open ended question but does anyone have any suggestions for how to implement calculating the axis of minimum moment of inertia? My initial thoughts are that I need to calculate a moment of inertia tensor matrix for which I need to calculate the moment of inertia of each element, similar to how I calculated the centre of mass, then combine it all through parallel axis theorem. From this matrix I can hopefully determine the axis of minimum moment of inertia for the object as well as the moment of inertial for various other axes. I am able to calculate the moment of inertia for an ‘element’ being a tetrahedron for one that has 3 of 4 faces orthogonal however this is not the case, we have 4 points one of which is an origin and 3 arbitrary ones.
Any thoughts, just spit-balling or otherwise would be appreciated.
Dan



