BRepAlgoAPI_Cut destroys contour


i have a problem with BRepAlgoAPI_Cut. I created a tableboard and an other Object which could be for example the way of a mortiser
The result after cutting them (BRepAlgoAPI_Cut(tableboard, mortiserWay)) ist that:
You can see that the "BRepAlgoAPI_Cut" destroys the contour of the table around the cut. I have no idea how i can avoid that.
The contour around the table is created out of curve which was built through "GeomAPI_Interpolate(pointsOfTheCurve, Standard_False, Precision::Approximation())".
I Hope somebody can help me, thanks.

arkoala's picture

In some place, I could read about BRepAlgoAPI_Cut strange behaviour, and it suggested to avoid parallel faces between both shapes (or it was only for performance purposes?).

So, I get bigger my solids in order to get good results.
But, it seems you cannot do the same. Try repeating the same process, but putting these two shapes in differente Z values (Without sharing the base face).

If artifacts are solved, you know the right path. If not, wait for a better answer!

Marco Matt's picture

Thank you for your reply. I have tried your hint, but unfortunately it dont solve the problem.

Roman Lygin's picture

Hi Marco,

To make sure this is Open CASCADE bug do the following in DRAW test harness:

>pload ALL
>restore shape
>restore tool
>checkshape shape
>checkshape tool
>bop shape tool
>bopcut result
>checkshape result
>vdisplay result
>vsetdispmode result 1

There's slim chance that you introduce errors somewhere upstream. How does your result display in a wireframe mode ? Another guess - geometry that has been changed during cut though valid causes some failures in meshing algorithm.

Good luck.
--- - the Open CASCADE blog

Marco Matt's picture

Hi Roman,

i have checked the shapes in the test harness.
The tableboard-shape and the mortiser-shape seems to be valid.
The check of the cut-result throws some faults:

On Shape faulty_1:
On Shape faulty_2:
On Shape faulty_3:
On Shape faulty_4:

Faulty shapes in variables faulty_1 to faulty_4

I have made a screenshot of the Draw Test Harness Console:
So it is a OCC bug?
Any idea how to avoiding this bug - maybe using an other way to create the contour.
Other type of curves or cutting the contour out of a simple solid and then cutting the
mortiser on it?

Thank you for your help!

Roman Lygin's picture

Hi Marco,
Well, it looks like an Open CASCADE bug :-(.
The error messages mean that connectivity has been set incorrect (if I get correctly from BRepCheck, this means that there are edges that are shared 3 times instead of 2 for a normal solid). Could you upload a picture with wireframe display to see how it looks in that mode ?

No clues upfront. Maybe you could try to extend your cut tool so that it's guaranteed to exceed a workpart boundaries. BOP are known to be sensitive to tangential cases, and if your shapes boundaries coincide this may cause an interference that can lead to various errors. Of course, it's only a guess which may not work in your case.

(By the way, as I already mentioned on this forum, I'm interested in collecting 3d models that demonstrate slow performance of BOPs. I use them to experiment with improving performance with Intel Parallel Amplifier. If your models are not confidential, you may want to send them to me, I could give them a look at my spare time).

--- - the Open CASCADE blog

Marco Matt's picture

Hi Roman,

i have uploaded some screens of the objects without textures.



table + mortiser:

table - mortiser:

The mortiser exceed the table and no parallels existing between the mortiser and the table.

Marco Matt's picture

Hi all,

i have solved my problem.
Up to now i have created the table out of rectangle on which i have added
objects with the contour. With this the result of the cut-operation is not
Now i create a rectangle and do not add object with the contour, but i create
the negative-form of the contour and cutting this form out of the rectangle.
The result shape of this way seems to be more persistend and the cutting of
the mortiser is successful.
The result of this you can see here:
I hope my explanation is understandable.

Thanks a lot to all who have tried to help me in this thread and via email!

Roman Lygin's picture

Hi Marco,

Glad you have overcome this, congratulations ! Your wireframe screenshots were helpful and the green on 'table-mortiser' indicates your solids got broken. This seems to explain why you got errors in DRAWEXE. As mentioned in Part 3, green color indicates a free edge (i.e. shared by a single face). Thus, you probably resulted having coincident but not shared edges (each in green).

On your new construction algorithm. So are you now creating a table by cutting (Boolean Cut ?) a profile-built tool from the original box ? And previously you used Boolean Fuse ? If so, I'm confused why you need Booleans at all. Why wouldn't you just create a solid from all its faces if you can construct both lateral and top, and bottom ones in a first place ? Just curious...

--- - the Open CASCADE blog