Close

Relief for ODA Team in Ukraine

Learn more
ODA Facet Modeler
Perform Slicing Operations

This chapter contains information on how to slice 3D objects.

Slicing a 3D object means getting a cross-section 3D profile of a body created by the specified plane.

To slice a 3D body you can use the slice() method:

void slice(const OdGePlane& rCutter, Profile3D& rResult, bool bIncludeBoundary = true) const;


For example, the following code snippet creates a Profile3D plane which represents a cube's cross-section:

Profile3D sliceBody(const DeviationParams& devDeviation)
{
  // Create a plane
  OdGePlane plane(OdGePoint3d(1.,1.,1.), OdGeVector3d(5.,4.,3.));
  
  // Create a body
  Body body = createCube(devDeviation);

  // Call the slice method and receive the resulting Profile3D
  Profile3D result;
  body.slice(plane, result, true);

  return result;
} 

See Also

Work With B-Rep Data in Facet Modeler
Create Basic Objects
Create Basic 2D Objects
Create Objects via Revolution
Create Objects via Extrusion
Iterate through Entities
Perform Boolean Operations
Calculate Area and Volume
Copyright © 2002 – 2022. Open Design Alliance. All rights reserved.