Overview
MTK allows to compute some key properties of a 3D model:
- bounding box;
- surface area;
- volume;
- centroid (center of mass).
Each property can be computed either for an entire ModelData::Model or for any ModelData::Assembly , ModelData::Part , and ModelData::Instance .
Bounding Box
Bounding box is an axis-aligned bounding box which encompasses a 3D model (or its component).
The following example demonstrates computation of a shape bounding box:
ModelData::Shape aShape = ...;
ModelData::Box aBox;
Geom::Transformation aTrsf;
Measurements::BoundingBox::Compute (aShape, aTrsf, aBox);
In addition to traditional bounding boxes, Manufacturing Toolkit also allows to compute minimum bounding box which is not necessarily axis-aligned:
ModelData::Shape aShape = ...;
ModelData::Box aBox;
Geom::Transformation aTrsf;
static void ComputeMin(const ModelData::Shape &theShape, ModelData::Box &theBox, Geom::Transformation &theOutTransformation)
Definition BoundingBox.cxx:361
Surface Area
The following example demonstrates computation of a shape surface area:
ModelData::Shape aShape = ...;
static double Compute(const ModelData::Model &theModel)
Computes the surface area of the model.
Definition SurfaceArea.cxx:57
Volume
The following example demonstrates computation of a shape volume:
ModelData::Shape aShape = ...;
static double Compute(const ModelData::Model &theModel)
Computes the volume of the model.
Definition Volume.cxx:691
Centroid
The following example demonstrates computation of a shape centroid (center of mass) :
ModelData::Shape aShape = ...;
static Geom::Point ComputeCentroid(const ModelData::Model &theModel)
Computes the center of mass of the model.
Definition ValidationProperties.cxx:50