| Customize Help

Defining 3D geometries



3D geometry objects must be allocated and defined before using them as a source in other 3D modules.

Steps to defining and using a 3D geometry object

The following steps provide a basic methodology for defining 3D geometry objects.

  1. Allocate a 3D geometry object on the specified system, using M3dgeoAlloc() with M_GEOMETRY.

  2. Define the geometry of the object by calling one of the 3D geometry definition functions (for example, M3dgeoBox() or M3dgeoCylinder()); see the 3D geometry objects subsection of this section. You can also copy a geometry result into the 3D geometry object to define it (for example, M3dimCopyResult() with M_BOUNDING_BOX).

  3. If necessary, manipulate the defined geometry object using the 3D Image Processing module. You can translate, rotate, scale, or otherwise transform the geometry using M3dimTranslate(), M3dimRotate(), M3dimScale(), or M3dimMatrixTransform(), respectively.

  4. Pass the 3D geometry object to a function that can take one (for example, M3dmetDistance() or M3dimCrop()).

  5. Free the 3D geometry object, using M3dgeoFree().

3D geometry objects

The following table lists all 3D geometries that you can define; it also indicates the M3dgeo...() functions that you can use to define them.

Geometry name

Example

Geometry definition function

Box

M3dgeoBox()

Cylinder

M3dgeoCylinder()

Line

M3dgeoLine()

Plane

M3dgeoPlane()

Sphere

M3dgeoSphere()