It’s possible to create section view on the model with help of clipping plane mechanism.
For the model:
View attachment 267
The result is the next:
View attachment 268
To implement this we create a clipping plane:
C++:
gp_Pln plane(gp_Pnt(), gp_Dir(1.0, 0.0, 0.0));
Handle(Graphic3d_ClipPlane) clipPlane = new Graphic3d_ClipPlane(plane);
Later, it’s possible setting this plane on AIS_Shape itself or in the view. Below the code is how to set it into the view:
C++:
Handle(Graphic3d_SequenceOfHClipPlane) clipping = view->ClipPlanes()
if (clipping.IsNull())
clipping = new Graphic3d_SequenceOfHClipPlane;
clipping->Append(clipPlane);
view->SetClipPlanes(clipping);