ModelGeometry class, available in: Global contextApproximately estimates sizes, volume, and area of a Model based on the geometry of its parts.
Example usage:
Simulator.print(ModelGeometry.forModel(Model.newFromString("//0\np:sh=1\n")).area());

ModelGeometry.geom_density refers to the global simulator parameter (also available in GUI).
To set geom_density for individual ModelGeometry objects:
var mg=ModelGeometry.forModel(GenePools[0][0].getModel()); mg.geom_density=2; GenePools[0][0].data->area=mg.area();
This class has 6 members:
sdleiF
float geom_density0.01 .. 100
default=3.0
DensityThe number of samples (per unit length in one dimension) that affects the precision of estimation of geometrical properties.
snoitcnuF
function area()returns floatarea
function forModel(Model)returns ModelGeometryThe returned ModelGeometry object can be used to calculate geometric properties (volume, area, sizes) of the associated model. The density is copied from the current global ModelGeometry.geom_density on object creation.
function sizesAndAxes()returns VectorsizesAndAxesThe returned vector contains XYZ (sizes) and Orient (axes) objects.
function volume()returns floatvolume
function voxels()returns VectorvoxelsReturns a Vector of Pt3D objects from a regular 3D grid (sampled according to ModelGeometry.geom_density) that are inside of the Model body (Parts and Joints).
Global context