The equation of the long axis of an arbitrary body

28 Views Asked by At

I have a set of points with three coordinates per each. These points creates a body (they are a component of the stl-file). The problem is to find a long axis of the body. How it can be done?

1

There are 1 best solutions below

2
On

Find the center of mass $m$ by averaging the points $P_i$ (assuming here that they are uniformly distributed in the body).

Compute $Q_i = P_i -m$, the displacements from the center of mass.

Place the $Q_i$ in an $n \times 3$ matrix, $Q$, where each row contains coordinates of one of the $Q_i$.

Let $H = Q^t Q$.

Use a software package to compute the SVD of $H$, $$ H = U D V^t $$ where, because $H$ is symmetric, it'll turn out that $V = U$ unless your object is basically spherical or has rotational symmetry.

The first row of $V$ (or column of $U$) will correspond to the main axis, if your object has one.

If your points are NOT a good representation of the distribution of material in your object, and are merely the vertices of a mesh whose interior is the object itself...then you have to do more work. You can look at this quite good paper on the topic:

Brian Mirtich. Fast and accurate computation of polyhedral mass properties. Journal of Graphics Tools: JGT, 1(2):31–50, 1996.

(see also: http://dl.acm.org/citation.cfm?id=643322) or, for a currently-available download, this.