Quote:> Then I was mislead by the conclusion of your introduction:

> | A simpler construction is provided here when the polyhedron faces

> | are triangles. A consequence of the formulas as derived in this

> | document is that they require significantly less computational time

> | than does Mirtich's formulas. I suspect that for nontriangular

> | faces, Mirtich's formulas are reducible to simpler expressions.

A paper does not consist solely of its introduction. Clearly

your background is such that you can see the idea as discussed

in the remainder of the document applies to simple polygon

faces. But my purpose for the paper is to stress the case of

triangle faces.

You can argue that for simple polygon cases my approach

requires you to construct planar coordinates for each vertex

of the face, whereas Mirtich's construction does not. I have

not investigated if the coordinate construction plus mass/inertia

calculations are more/less than Mirtich's. Even if you had the

face triangulation available so that coordinate construction is

not necessary, the operation count is significantly large enough

in Mirtich's approach that you would want to find the

break-even point where the number of triangles finally causes

my method to use more cycles; that point is dependent on

which case you arrive at in Mirtich's formulas.

For rigid bodies, it is quite irrelevant which formula you use

since you compute the mass and inertia tensor (in body

coordinates) just once. For deformable bodies where you

have to compute the inertia tensor each time step, using

simple polygon faces is problematic. At one time step

you have a simple polygon face. At the next time step

the vertices of that face are most likely not coplanar. What

are you going to do? No problem when you use triangle

faces.

Quote:> Agreed, triangle meshes predominate. But OP did not restrict to that,

> and otherwise your code needs adaptation which, while simple for the

> experienced, may not be so for OP.

Neither did the OP restrict his problem to rigid bodies.

If his faces are not triangular, he has to modify Mirtich's

code as well. Maybe the OP has deformable bodies with

trimmed surface patches. In that case, neither Mirtich's nor

my approach will help. I am not the one who posted the

reference to Mirtich's paper :)

Quote:> I have no complaint. In fact, it bothered me that Mirtich thought it

> necessary to project the faces.

I have no complaint about Mirtich's paper. Since the "area of

a 3D polygon" problem is solved by projecting to the appropriate

coordinate plane, it is only natural you would try the same idea

for mass/inertia. Neither did I like the projection of faces. That

is why I investigated the alternative. Regardless, none of this is

rocket science. The application of Green's theorem is a topic in

an undergraduate calculus class. I suspect Green himself investigated

all these applications that folks seem to "discover" nowadays (more

appropriate might be to say "rediscover").

Quote:> ...Perhaps I triggered this by saying his code was efficient (his claim,

> with numbers). It could be ten times slower and still suffice for OP

> I wager. What really worries me here is not the relative merits of

> your code versus Mirtich,...

Yes, this is how it was triggered, but your response to Christer's

post *was* about the relative merits :)

Quote:>... but the sense that we're killing a fly with a cannon.

> To remind us all of the original request, OP was merely trying to find

> some kind of "center" for a body, specifically mentioning a cube as a

> simple example. :)

The OP did mention some faces of the cube might be subdivided to

have more triangles than other faces. If he plans on computing the

center of mass using the triangle face information, our discussion is

quite relevant.

--

Dave Eberly

http://www.magic-software.com

http://www.wild-magic.com