#### Archived

This topic is now archived and is closed to further replies.

# Tetrahedralization and a major bummer

This topic is 5949 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I just had a major disappointment. Heres what i had in mind : Mesh consisting of triangles can be verified to form a "solid" polyhedra ( concave, no gaps no holes ) if -every edge is shared by exactly two triangles -none of triangles are intersecting Now for physics calculations ( mass , centre of mass ) i thought that im going to decompose such meshes into tetrahedrae, and calculate each one of them separately, then just take a sum of them. After couple of hours searching for algorithms on tetrahedralization ( basically triangularization in 3d ) i ran across this page http://www.cs.mcgill.ca/~kitching/cs507/intro.html I''ll need to find some other method of finding mass of arbitrary polyhedrae. Its basically integrating over a volume, the math involved gives me creeps already. Any pointers ?

##### Share on other sites
If your polyhedron is convex, you can choose a point in the middle. Then the polyhedron is made up of several pyramids - one for each face. If you first break the faces into triangles to start with, you have (irregular) tetrahedra.
Then volume = Area * height / 6 (measure height perpendicular to plane of face)
CoM is on the line between the middle of the triangle, a quarter of the way from the base to the point. That''s unless you''re playing with variation in density.
I guess these were the things you had worked out already.
This won''t always work if it''s concave, however. They may need to be specified as a number of polyhedra joined together.

##### Share on other sites
Minor terminology correction: the singular of polyhedra is polyhedron not polyhedrae (according to my dictionary, which I checked!)

Your approach to sum the properties of individual tetrahedrons isn''t quite correct. For mass it will work, but for center-of-mass and inertias you''d have to then treat each individual polyhedron as a new point object, located at its local center of mass and carrying inertia properties. Then integrate over the point objects to calculate the global center of mass and inertias using the parallel axis theorem. This is not difficult, just more work than a simple summation.

Try this paper:

Brian Mirtich, "Fast and Accurate Computation of Polyhedral Mass Properties," journal of graphics tools, volume 1, number 2, 1996,

available in postscript form here:

http://www.cs.berkeley.edu/~mirtich/publications.html

And the accompanying (public domain!) source code:

http://www.acm.org/jgt/papers/Mirtich96/source.tar

That may do the trick! This code should give you the mass *and* inertias of arbitrary polyhedra, and I don''t believe you''ll even need to split it into individual polyhedrons!

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.

##### Share on other sites
great thanks guys.
[If your polyhedron is convex, you can ]
yeah thats the problem, they arent convex, but your idea with choosing the point in the middle is quite good. It wont work in this case though. Basically what i have is bunch of construction parts ( like lego or something ) that can be fitted together for modeling more complex machinery ( submarine fighter ships, primarily )

[For mass it will work, but for center-of-mass and inertias ]
For center of mass, its weighted average , is it not ? eg. cm_x = sum( cm_1_x * mass_1 , cm_2_x * mass_2 etc ) where cm_n and mass_n are center of mass and mass of each separate tetrahedron ?
For inertia i was simply planning to use inertia tensor calculated on bounding box of the whole model. Might not be accurate but works , at least for starters

[Brian Mirtich, "Fast and Accurate Computation of Polyhedral Mass Properties,"]
yeah i found this one too and tested the code, it works quite well. But im unable to read the paper itself, PStill wont convert it to PDF properly, and i have no other means of reading postsript files under Win98 Id like to understand the concept they are using, instead of just taking the code.

Edited by - no way on September 28, 2001 2:35:22 PM

Edited by - no way on September 28, 2001 2:36:20 PM

##### Share on other sites
For center of mass, take your sum and divide by total mass and your golden:

  cm_x = sum( cm_1_x * mass_1 , cm_2_x * mass_2 etc )/sum(mass_1, mass_2, etc)

Yes, just that one extra step. Inertias are a bit different, since the shift to global center of mass depends on the square of distance from the object center of mass.

Of course your approach to compute inertias from the bounding box will work. I would recommend that you use an oriented bounding box if you can, one that best fits the *shape* of the object(s). Since your objects are lego-like, you shouldn''t have any problem!

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.

##### Share on other sites
http://amp.ece.cmu.edu/Publication/Cha/icip01_Cha.pdf

Thats really what i was looking for. Good and easy-to-understand explanations inside.