Find out if there is an orientation in which your 3D mesh can stand still
- Ziv Shahaf
- Kujan Lauz
As part of a 3D-Printing Seminar, under the guidance of Professor Gershon Elber, We wanted to identify, given an input 3D model, Which orientations of the model are suitable for 3D printing.
To find the orientations we needed to come up with an algorithm for finding all the facets (2D planes) on which the 3D model can "stand still".
Start with a 3D mesh input, calculate its convex hul and center of mass. Using CH and COM find balancing facets
A minimalistic OBJ file parser was created, with some additional implementation of some geometric representation classes: Vector, Matrix, Polygon3D and Geometric tools for 2D and 3D calculations.
Used Qhull under copying right (http://www.qhull.org/COPYING.txt) to get the convex hull of the processed mesh. Qhull have a very un-intuitive library/API and lack proper documentation so after finding out how to use it for our needs I answered a relevant StackOverflow question
To calculate the center of mass, we used volInt.c
(one of its versions can be found here), the source code of Fast and Accurate Computation of Polyhedral Mass Properties by Brian Mirtich .
An O(N) algorithm where N is the number of facets of the convex hull.