On Apr 09, 2013, at 10:55 AM, Csaba Nagy <[email protected]> wrote:

Now "analyze sph_hollow.r" gives me:

analyze: unable to process ID_COMBINATION solid
 
Volume and surface area calculations are not implemented for combination (created via 'r') objects.  That message could be improved to somehow say sph_hollow.r is not a primitive shape and/or not supported by the analyze command and/or make it work by calling gqa.  Yet another patch opportunity for someone.

You can get the volume of any geometry, including combinations, with the gqa command (still called g_qa in a few places).  We have a TODO to migrate gqa's logic to a library.
 
For volume, I see 2 interpretations:

* only calculate volume which is materially taken by the object (so
that volume*density=weight);
 
This is usually called mass volume, or just volume.

* calculate the "boundary volume" -> imagine submerging the object
completely in water, and calculate the volume of water it would
displace;

This is usually called the displacement volume.

Both can be of interest for different applications.

Certainly, but the latter requires awareness of being inside an interior void with no path to the exterior.  We don't currently implement that.  It's easy for a sphere bounded by a sphere, but I could contrive a more complex shape that'd be near impossible to evaluate without sampling.  The gqa command could figure out the latter as an option (displacement(obj) = vol(bbox(obj)) - vol(obj) - vol(exterior bbox segments)), but it'd be a niche calculation.  I've never heard anyone ask for it.

>From an algorithm POV I would prefer the "material volume" and "total
surface" approach - they are the easiest to calculate. But the "boundary
volume" and "reachable surface" could be valuable functions too !

I agree, but as noted it can be tricky to compute more than the mass volume and total surface area.  I'd rather just get to the point where we correctly calculate volume, surface area, and centroid for everyone, then we can extend it to exterior surface area and displacement as well.

tl;dr Use gqa to verify your volume calculations. ;)

Cheers!
Sean

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
BRL-CAD Developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-devel

Reply via email to