To add a cross section for a view, set a clipping plane for the custom view (the custom view must be created previously).
For example, to create a view with an XZ clipping plane:
OdPrcPlanePtr pPlane = OdPrcPlane::createObject();
OdGeVector3d normal(0.0, 1.0, 0.0);
OdGePoint3d origin(0.0, 0.0, 0.0);
normal.normalize();
OdGePlane gePlane(origin, normal);
OdGeInterval intU(-3., 3);
OdGeInterval intV(-3., 3);
setPlaneEnvelope(&gePlane, intU, intV);
pPlane->setFromOdGeSurface(gePlane);
The normal vector of the clipping plane determines the section direction for the object's part that will be removed.
OdPrcSurfacePtrArray &viewClippingPlanes = ((OdPrcSceneDisplayParameters*)pSceneDisplayParameters)->clippingPlanes();
viewClippingPlanes.push_back(pPlane);
The result of adding a clipping plane to the view is illustrated below.
![]() |
|
Note that the .prc file format specification does not prohibit creating several clipping planes per view, but viewer applications (for example, Adobe® Reader) do not support this feature and can apply only one clipping plane.
Working with clipping planes is illustrated in ODA PRC SDK sample applications:
To get access to this function in the OdaPrcApp sample application, select Edit -> Registered Commands -> Cross Section -> CROSSSECTION.
![]() |
|
Copyright © 2002 – 2020. Open Design Alliance. All rights reserved.
|