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

Overview

CAD Exchanger SDK 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 model (ModelData_Model) or for any assembly, part, instance, or part representation.

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 part's bounding box:

ModelData_Part aPart = ...;
ModelData_Box aBox;
static void Compute(const ModelData_Model &theSG, ModelData_Box &theBox, bool theForcedFlush=true)
Returns a bounding box of a scene graph.
Definition: ModelAlgo_BoundingBox.cxx:346

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

ModelData_Part aPart = ...;
ModelData_Box aMinBox;
ModelData_Transformation aTrsfToApply;
ModelAlgo_BoundingBox::Compute (aPart, aMinBox, aTrsfToApply);

aMinBox contains an axis-aligned box which would be returned if the part were transformed with the help of returned transformation.

Note
The computation of minimum boxes is currently in feature preview state. Its API may change, so binary compatibility can be broken.

Surface Area

Surface area only can be computed for parts having a solid or sheet body in their B-Rep representation.

The following example demonstrates computation of a part's surface area:

ModelData_Part aPart = ...;
static double ComputeSurfaceArea(const ModelData_Model &theModel, bool theUseProperty=false, bool theStoreProperty=false)
Returns a surface area of a scene graph.
Definition: ModelAlgo_ValidationProperty.cxx:362

Volume

Volume can only be computed for parts having a solid body in their B-Rep representation.

The following example demonstrates computation of a part's volume:

ModelData_Part aPart = ...;
static double ComputeVolume(const ModelData_Model &theModel, bool theUseProperty=false, bool theStoreProperty=false)
Returns a volume of a scene graph.
Definition: ModelAlgo_ValidationProperty.cxx:402

Centroid

Centroid (center of mass) can only be computed for parts having B-Rep representations.

The following example demonstrates computation of a part's centroid:

ModelData_Part aPart = ...;
ModelData_Point aCentroid;
static void ComputeCentroid(const ModelData_Model &theModel, ModelData_Point &theValue)
Returns a center of mass of a scene graph.
Definition: ModelAlgo_ValidationProperty.cxx:450

Wall Thickness

The wall thickness algorithm is currently available in the Manufacturing Toolkit. Refer to Wall thickness calculation for details.

Examples

Refer to Measurement examples.