Hide menu
Loading...
Searching...
No Matches
Basic Measurements

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 the smallest axis-aligned box that fully contains a 3D model (or its component).

The following example demonstrates computation of a shape bounding box:

aShape = ... # mtk.ModelData_Shape
aBox = mtk.ModelData_Box()
aTrsf = mtk.Geom_Transformation();
mtk.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:

aShape = ... # mtk.ModelData_Shape
mtk.ModelData_Box aBox = mtk.ModelData_Box()
mtk.Geom_Transformation aTrsf = mtk.Geom_Transformation();
mtk.Measurements_BoundingBox.ComputeMin (aShape, aBox, aTrsf)

Surface Area

The following example demonstrates computation of a shape surface area:

aShape = ... # mtk.ModelData_Shape
r = mtk.Measurements_SurfaceArea.Compute(aShape)

Volume

The following example demonstrates computation of a shape volume:

aShape = ... # mtk.ModelData_Shape
r = mtk.Measurements_Volume.Compute(aShape)

Centroid

The following example demonstrates computation of a shape centroid (center of mass) :

aShape = ... # mtk.ModelData_Shape
aCentroid = mtk.Measurements_ValidationProperties.ComputeCentroid(aShape)

Distance

The following example demonstrates the computation of the distance between two shapes:

aFirstShape = ... # mtk.ModelData_Shape
aSecondShape = ... # mtk.ModelData_Shape
aDistance = Measurements_Distance.Compute (aFirstShape, aSecondShape)

Angle

The following example demonstrates the computation of the angle between two planar faces:

aFirstFace = ... # mtk.ModelData_Face
aSecondFace = ... # mtk.ModelData_Face
anAngle = Measurements_Angle.Compute (aFirstFace, aSecondFace)