For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings


Need to speed up your development?
Have a look at our:

Samples & Tools


Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

Clipping plane bug in 3.0

Philippe Carret's picture

After some hours to check my own code (that was perfectly working with OL2.0) to look after errors I clearly think now there's a bug with clipping plane.

To check it I've modified the sample 04_SampleViewer3d\SampleViewer3d.exe

I've explained below all the step and the code :

The aim is to modify the code to be able to adjust the size of the box dynamically instead of having a single stable box

// 1) add a resource : create the icon in the toolbar ID_GROW_BOX

// 2) in .h // add the member

Handle(AIS_Shape) myBox;

// 3) in .cpp


// change a little original code void CSampleViewer3dDoc::OnBox() {

BRepPrimAPI_MakeBox aBox(gp_Pnt(0,-400,-100),x0,y0,z0);

if (myBox.IsNull())

myBox = new AIS_Shape(aBox.Shape());

myAISContext->Display(myBox); }

// add the message handler void CSampleViewer3dDoc::OnGrowBox() {

static float x0(200.);

static float y0(150.);

static float z0(100.);

if (myBox.IsNull())


BRepPrimAPI_MakeBox aBox(gp_Pnt(0,-400,-100),x0,y0,z0);


if (myAISContext->IsDisplayed(myBox))




x0 *=1.5;

y0 *=1.5;

z0 *=1.5; }

4) TO SEE THE PROBLEM : Launch the .exe and Grow the box 5 times (5*1.5) and rotate the view. The box is clipped. I hope It can't come from graphic card

5) another strange behavior in the same sample :

Create the box, sphere, cylinder objects Use the model clipping dialog, check the box and the cursor until all the objects are clipped to their middle plane. Then rotate the view and you'll see that object don't keep their shape. Perhaps it has the same strange bug as above.