Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Tetrahedralization and a major bummer


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 no way   Members   -  Reputation: 122

Like
Likes
Like

Posted 27 September 2001 - 01:07 PM

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 ?

Sponsor:

#2 AndyMan   Members   -  Reputation: 148

Like
Likes
Like

Posted 27 September 2001 - 08:45 PM

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.



#3 grhodes_at_work   Moderators   -  Reputation: 1361

Like
Likes
Like

Posted 28 September 2001 - 04:44 AM

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.

#4 no way   Members   -  Reputation: 122

Like
Likes
Like

Posted 28 September 2001 - 07:34 AM

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

#5 grhodes_at_work   Moderators   -  Reputation: 1361

Like
Likes
Like

Posted 28 September 2001 - 10:01 AM

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.

#6 no way   Members   -  Reputation: 122

Like
Likes
Like

Posted 09 October 2001 - 05:36 PM

http://amp.ece.cmu.edu/Publication/Cha/icip01_Cha.pdf

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




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS