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:

using namespace cadex;
ModelData::Shape aShape = ...;
Measurements::BoundingBox::Compute (aShape, aTrsf, aBox);
Defines a transformation matrix.
Definition Transformation.hxx:33
Defines a 3D axis-aligned bounding box.
Definition Box.hxx:30
Base class of topological shapes.
Definition Shape.hxx:38
Contains classes, namespaces, enums, types, and global functions related to Manufacturing Toolkit.
Definition LicenseManager_LicenseError.hxx:30

In addition to traditional bounding boxes, Manufacturing Toolkit also allows to compute minimum bounding box which is not necessarily axis-aligned:

using namespace cadex;
ModelData::Shape aShape = ...;
static void ComputeMin(const ModelData::Shape &theShape, ModelData::Box &theBox, Geom::Transformation &theOutTransformation)
Definition BoundingBox.cxx:486

Surface Area

The following example demonstrates computation of a shape surface area:

using namespace cadex;
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:

using namespace cadex;
ModelData::Shape aShape = ...;
double r = Measurements::Volume::Compute (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) :

using namespace cadex;
ModelData::Shape aShape = ...;
Defines a 3D point.
Definition Point.hxx:35
static Geom::Point ComputeCentroid(const ModelData::Model &theModel)
Computes the center of mass of the model.
Definition ValidationProperties.cxx:50

Distance

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

using namespace cadex;
ModelData::Shape aFirstShape = ...;
ModelData::Shape aSecondShape = ...;
double aDistance = Measurements::Distance::Compute (aFirstShape, aSecondShape)
static double Compute(const ModelData::Shape &theFirstShape, const ModelData::Shape &theSecondShape)
Computes the distance between theFirstShape and theSecondShape.
Definition Distance.cxx:39

Angle

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

using namespace cadex;
ModelData::Face aFirstFace = ...;
ModelData::Face aSecondFace = ...;
double anAngle = Measurements::Angle::Compute (aFirstFace, aSecondFace)
static double Compute(const ModelData::Face &theFirstFace, const ModelData::Face &theSecondFace)
Computes the angle between two faces.
Definition Angle.cxx:55
Defines a topological face.
Definition Face.hxx:33