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;
}
Copyright © 2002 – 2020. Open Design Alliance. All rights reserved.
|