Skip to content

Extended functionality for calculating volume of Boolean shapes

Evgueni Tcherniaev requested to merge evc/GeoModel:evc/volume into main
  • m_volume added into GeoShape

  • volume(int npoints)

User can now specify the number of random points to be used for estimation the volume, the default is 1M points

  • getVolumeValue(), setVolumeValue()

First method just returns current value of m_volume, second method sets m_volume

  • isPolyhedron()

Returns true if all constituents of the shape are polyhedra, false otherwise

  • getNoConstituents()

Returns total number of constituents

  • Volume of GeoShapeUnion(A,B) is now calculated as:
A.volume() + B.volume() - GeoShapeIntersection(A,B).volume()
  • Volume of GeoShapeSubtraction(A,B) is now calculated as:
A.volume() - GeoShapeIntersection(A,B).volume()
Edited by Evgueni Tcherniaev

Merge request reports