Centre of Mass of a Polyhedron

Started by
16 comments, last by Basiror 19 years, 7 months ago
Quote:Original post by badmoon
Quote: Original Post by Dmytry
it must work with non-convex polyhedrons, you will have nonzero resulting mass only inside polyhedron - "negative" masses will do the job.


Do you mean the first method will work for non-convex polyhedrons? Because in this case some of your pyramids could partly be inside the mesh and partly not, so if you look at just their positive volume (i.e. the part in the mesh) it's no longer a pyramid but one with 'bits' missing from it - and that just makes another polyhedron so we haven't simplified the problem.

If you meant the 2nd method will work for non-convex polyhedrons, then can you elaborate more on this, because I still can't quite see how this would work

Both should work with non-convex polyhedrons, i think. It's why we need negative masses. And if you'll draw thing, you'll see that for every "wrong" positive volume you have "negative" volume that removes wrong part from positive volume.
For 2d case you can do a drawing, it's simple to see that.

For 3d case, if it will work when P is placed outside of convex polyhedron,it will work with non-convex polyhedrons.
If divide non-convex polyhedron into convex using some polygons, each such polygon is added to our summ twice, with opposite signs, so it's same as if you don't divide.

So it's needed to only prove that it will work if P is placed outside of convex polygon. Can be proven using equations(the only more-or-less reliable way to prove things), but probably it's waay too long.
My English is not good enough to prove that "in words".
Advertisement
Quote:Original post by badmoon
Quote:Original post by Basiror
hm just a suggestion

how about getting the center of each triangle/polygon and then get the center of all centers and use this as the center of mass?


its a approximation but i think this should work as well as the pyramid thing


The pyramid thing is not an approximation. But are you sure this method you suggest is an approximation? 'Cause if it wasn't that would be great. Can you give me an example where this would not work
What if you had a mostly simple cube, two triangles to each face, and six faces. But one face wasn't actually just 2 triangles, but was actually a complex set of many triangles. That face would be heavily favored when calculating the averages of all centers of all triangles.

And improvement on this would be to weight the center of each triangle according to its area. Larger triangles would contribute more than smaller triangles. I still think this'll end up being an approximation, though. (Trying to think of a case that would prove it easily.)

But by that point, take it one step further, and you have Dmytry's suggestion, because instead of using weighted triangles, you use weighted pyramids. And instead of getting an approximation, you get the exact value.
Above AP was me. Got logged out for some unknown reason...
"We should have a great fewer disputes in the world if words were taken for what they are, the signs of our ideas only, and not for things themselves." - John Locke
Quote:Original post by badmoon
Quote:Original post by Basiror
hm just a suggestion

how about getting the center of each triangle/polygon and then get the center of all centers and use this as the center of mass?


its a approximation but i think this should work as well as the pyramid thing


The pyramid thing is not an approximation. But are you sure this method you suggest is an approximation? 'Cause if it wasn't that would be great. Can you give me an example where this would not work

it's, if it's correctly done(weight in average is proportional to surface of triangle), is a center of mass of surface. It will not work right with volumes. Imagine we have sphere with one side is smooth and other have many small hills and canyons. Center will be closer to non-smooth side.
Quote:Original post by Dmytry
Both should work with non-convex polyhedrons, i think. It's why we need negative masses. And if you'll draw thing, you'll see that for every "wrong" positive volume you have "negative" volume that removes wrong part from positive volume.
For 2d case you can do a drawing, it's simple to see that.

For 3d case, if it will work when P is placed outside of convex polyhedron,it will work with non-convex polyhedrons.
If divide non-convex polyhedron into convex using some polygons, each such polygon is added to our summ twice, with opposite signs, so it's same as if you don't divide.

So it's needed to only prove that it will work if P is placed outside of convex polygon. Can be proven using equations(the only more-or-less reliable way to prove things), but probably it's waay too long.
My English is not good enough to prove that "in words".


By god you're right, I've just drawn out an example in 2D and it worked out - the negatives cancelled out the positive exactly to give the area of the shape.
Does anyone know how to paste in a bitmap or gif or something.

So looks like I'm almost sorted - is there a good way of picking a point in the mesh. I know how to work out whether a point is inside a mesh but how do you pick one?

Also, does anyone know how you calculate the inertia tensor of a rigid body? This is a matrix, and I need this to correctly compute the result in collision responses between rigid bodies. I'm aware of a numerical method that finds an approximation but it becomes very expensive time-wise when trying to get a decent amount of accuracy



The origin seems a good point. I don't think it matters if it is inside, outside or on the surface of the mesh. The only real differance with being on the surface is that some of the volumes would be zero.
Keys to success: Ability, ambition and opportunity.
Quote:Original post by badmoon
Quote:Original post by Dmytry
Both should work with non-convex polyhedrons, i think. It's why we need negative masses. And if you'll draw thing, you'll see that for every "wrong" positive volume you have "negative" volume that removes wrong part from positive volume.
For 2d case you can do a drawing, it's simple to see that.

For 3d case, if it will work when P is placed outside of convex polyhedron,it will work with non-convex polyhedrons.
If divide non-convex polyhedron into convex using some polygons, each such polygon is added to our summ twice, with opposite signs, so it's same as if you don't divide.

So it's needed to only prove that it will work if P is placed outside of convex polygon. Can be proven using equations(the only more-or-less reliable way to prove things), but probably it's waay too long.
My English is not good enough to prove that "in words".


By god you're right, I've just drawn out an example in 2D and it worked out - the negatives cancelled out the positive exactly to give the area of the shape.
Does anyone know how to paste in a bitmap or gif or something.

So looks like I'm almost sorted - is there a good way of picking a point in the mesh. I know how to work out whether a point is inside a mesh but how do you pick one?

Also, does anyone know how you calculate the inertia tensor of a rigid body? This is a matrix, and I need this to correctly compute the result in collision responses between rigid bodies. I'm aware of a numerical method that finds an approximation but it becomes very expensive time-wise when trying to get a decent amount of accuracy

it doesn't matter if P is inside or outside... just use one vertice of mesh as P(so you also don't need to add triangles with P as vertice) .

As about inertia tensor, i don't know, haven't did myself. Probably something kinda similar to that method.
There was something at http://www.magic-software.com/
Also, check PS document from first linkey.(and google).
Quote:Original post by badmoon
I like the method you suggested for splitting my mesh into pyramids, but that will only work for convex polyhedrons - I cannot gaurantee this property for all my meshes (I'd have to split them up into convex partitions and I don't want to go through that hassle).

The second method you mentioned using 'projected prisms' seems quite ingenious, but will it only work for convex polyhedrons?

A site that would explain all this would be great, if you know of one...


well if the pyramid thing only works with convex volumes then i could imagine that my attempt of a approximation by the center of triangles would come very close to the result of the pyramids


now to the case where there were several coplanar triangles on one side, a convex volume can be descibed by x coplanar planes with normals pointing away from the center

you could get t he face intersections of all planes and calculate convex polygons instead of triangles so you get only one polygon per side and thus only one center per side

i haven t tried it yet, but i think it s a good alternave


btw if you have a convex volume and want to create pyramids out of the triangles and weight those, i am pretty sure the results are fairly equal at least for a spheric volume and for a quadratic


could someone who s got a physique engine up and running try this out? would be quite interesting to see some results
http://www.8ung.at/basiror/theironcross.html

This topic is closed to new replies.

Advertisement