PDA

View Full Version : calculate volume of an organic object?


shokan
02-13-2011, 02:36 AM
I was told I can get the volume of an organic object in Softimage. As a beginner, how do I do this?

Thanks.

ThE_JacO
02-13-2011, 03:05 AM
It's not trivial. The volume of an arbitrary object cannot be obtained analitycally. You'd have to do a volume sweep of the object and get the sum of the approximate volume between the sweeps, which remains an approximation anyway.
or you could triangulate the mesh and fit tetrahedrons per each facet for a precise result, it's again far from trivial though.
have a look at the object info property and see if there's something there, but if you're after implementing yourself, it might be a length or two from beginner level.

Hirazi
02-13-2011, 11:05 AM
Don't know if this helps, but there is an ICE Attribute for polygonal meshes named "Volume", which gives you, according to the documentation, "(t)he volume of polygon meshes in cubic Softimage units." If you however access this attribute through a ICE display attribute it doesn't get updated correctly. If you however script it (and freeze any scaling, before querying the attribute), it seems to work.
The following script in Python does seem to do the trick:

Application.ResetTransform("", "siCtr", "siScl", "siXYZ")
myattr = Application.Selection(0).ActivePrimitive.Geometry.GetICEAttributeFromName("Volume").DataArray[0]
Application.LogMessage(myattr)

(Ignore & delete the spaces between Geometry and GetICEAttributeFromName, they were fabricated by the CGTalk post editor...)

grahamef
02-15-2011, 06:33 PM
You can also get the volume in the Info Selection box (Shift+Enter).

It's not trivial. The volume of an arbitrary object cannot be obtained analitycally. You'd have to do a volume sweep of the object and get the sum of the approximate volume between the sweeps, which remains an approximation anyway.
or you could triangulate the mesh and fit tetrahedrons per each facet for a precise result, it's again far from trivial though.
have a look at the object info property and see if there's something there, but if you're after implementing yourself, it might be a length or two from beginner level.

What's wrong with picking an arbitrary plane outside of the object's bbox, and then summing the volumes of the truncated prisms corresponding to each polygon (considering prisms on the underside to have negative volume)?

ThE_JacO
02-15-2011, 10:32 PM
My post came out a mess as I mixed up the actual thread with stuff that was rattling in my skull from things we're doing at work, and then forgot about it.
It can be safely disregarded in its entirety, unless you're into de-intersecting arbitrary volumes by level sets :)

Apologies for that.

ShaderOp
02-17-2011, 05:14 AM
Since volume sweeps and truncated prisms have already been brought up, here's another possible ICEy way of doing it:




Find the object's bounding box.
Randomly place a known number of particles inside the bounding box.
Count the number of particles that are actually inside the object.
Object's volume ~= (volume of bounding box) * (number of particles inside the object) / (total number of particles).
????
PROFIT!

oddforce
02-17-2011, 11:33 AM
Not sure but it could also be possible also to use a point (like 0,0,0) instead of a plane, and sum up tetrahedrons instead of the prisms.

CGTalk Moderation
02-17-2011, 11:33 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.