# How to obtain a parametric equation out of a part designed in Autodesk Inventor?

Whenever you make a part in inventor, the software calculates de properties of the whole body given a constant density. Then, automatically, it shows the inertial tensor. As you can recall from math, the inertia equation is $$I_x= \rho\int(y^2+z^2)dV$$ for the x axis. So, clearing rho, how can I get the right hand of the equation that is been solved in the underlying algorithm without doing any hand calculations?

I guess your question is how to compute the inertia tensor automatically. A parametric equation may not be always possible, but we could write a program to avoid hand calculations as much as possible.

The inertia tensor $$\mathbf{I}$$ is defined as an integral over the object domain $$\Omega$$ (see Inertia tensor): \newcommand{\V}[1]{\mathbf{#1}} \begin{align} \V{I} &= \int_\Omega \rho (\V{r}\cdot\V{r} \delta - \V{r}\V{r}^T)\,dV \end{align} where $$\V{r}$$ is the position relative to the center of mass (COM),$$\rho$$ is the density, and $$\delta$$ is the identity matrix.

Note that $$\text{tr}(\V{r}\V{r}^T) = \V{r}\cdot \V{r}$$, the above definition can be rearranged as \begin{align} \V{T} &= \V{r}\V{r}^T \\ \V{I} &= \int_\Omega \rho (\text{tr} \V{T} \delta - \V{T})\,dV \end{align}

## Analytic object

For analytic objects you can substitute their equations into the integral and do symbolic integration. This step can be automated with any symbolic computing software.

## Object in tetrahedral mesh

We assume the object is simple and has a closed boundary. An analytic solution is not possible in this case because we do not have an explicit equation for the object. But we could compute the inertia tensor numerically. The only integral we have to compute is \begin{align} \V{C} &= \int_\Omega \rho \V{r}\V{r}^T\,dV \end{align}

To compute this integral, this paper could be helpful. The general idea is to compute $$\V{C}_t$$ for each tetrahedron $$t$$, and sum $$\V{C}_t$$ to get $$\V{C}$$. We first compute the integral for a canonical tetrahedron $$t0$$ whose vertices are $$(0,0,0)$$, $$(1,0,0)$$, $$(0,1,0)$$, and $$(0,0,1)$$.

In maple, this canonical integral $$\V{C}_{t0}$$ is (assume $$\rho$$ constant)

r:=<x,y,z>;
[x]
[ ]
r := [y]
[ ]
[z]

with(LinearAlgebra):
rrt:=r.Transpose(r);
[ 2               ]
[x      x y    x z]
[                 ]
rrt := [        2        ]
[x y    y      y z]
[                 ]
[               2 ]
[x z    y z    z  ]

seq(seq(int(int(int(rrt[i,j],x=0..1-y-z),y=0..1-z),z=0..1),i=1..3),j=1..3);
1/60, 1/120, 1/120, 1/120, 1/60, 1/120, 1/120, 1/120, 1/60


Then the integral $$\V{C}_t$$ can be computed by a change of variable. Assume the coordinates of a world space tetrahedron can be represented as $$\V{r}=\V{F}\V{r}_0 + \V{x}$$, where $$\V{F}$$ and $$\V{x}$$ are constant. We have \begin{align} \V{C}_t &= \rho \int_{\Omega_t} \V{r}\V{r}^T\,dV \\ &= \rho \int_{\Omega_{t0}} (\V{F}\V{r}_0 + \V{x})(\V{F}\V{r}_0+\V{x})^T \det \V{F} \,dV_0 \\ &= \rho \int_{\Omega_{t0}} (\V{F}\V{r}_0\V{r}_0^T\V{F}^T + \V{x}\V{x}^T + \V{F}\V{r}_0\V{x}^T + \V{x}\V{r}_0^T\V{F}^T) \det \V{F} \,dV_0 \\ &= \det(\V{F}) \V{F}\V{C}_{t0}\V{F}^T + \det(\V{F}) m \V{x}\V{x}^T + \det(\V{F}) m \V{\bar{r}}\V{x}^T + \det(\V{F}) m \V{x}\V{\bar{r}}^T \end{align} where $$\V{\bar{r}}$$ is the COM and $$m$$ is the mass.

## Objects in other form

I did not use Inventor before but I suspect the part produced by it may have other formats, such as Bezier surface. For now I would suggest tetrahedralize the object and apply the above method.