How can we calculate the volume of a 3D object using the new-in-10 computational geometry functions?
For simple objects this works:
shuttle = ExampleData[{"Geometry3D", "SpaceShuttle"}]
Volume@BoundaryDiscretizeGraphics[shuttle]
(* 55.5217 *)
But BoundaryDiscretizeRegion
tends to fail on more complex geometries:
{deimos = ExampleData[{"Geometry3D", "Deimos"}],
phobos = ExampleData[{"Geometry3D", "Phobos"}]}
BoundaryDiscretizeGraphics[deimos]
BoundaryMeshRegion::binsect: The boundary curves self-intersect or cross each other in BoundaryMeshRegion[{{-0.473472,5.76096,0.000999842},{-0.32066,5.70981,0.233476},{-0.0747657,5.65315,0.231889},<<46>>,{-2.88191,5.74069,0.489521},<<9360>>},{{},{},{Polygon[{{1,2,3},<<49>>,<<18766>>}]}}]. >>
In general, what is a good way to proceed when we need to treat an object as a solid 3D volume (not surface!) for various purposes, such as triangulation, solving a PDE inside it, calculating a volume, or using it as an integration region?
Here are two more practical test cases:
bunny = ExampleData[{"Geometry3D", "StanfordBunny"}]
horse = ExampleData[{"Geometry3D", "Horse"}]
The Stanford bunny is especially relevant because originally it was created from voxel data (a common application).
Comments
Post a Comment