Bug in BRepAlgoAPI_Fuse

I am posting this here because I did not find any instructions on opencascade.org about how to report bugs. I hope someone working on BRepAlgo will read this. If you try running the following Fuse operations, the resulting shape has lots of missing faces:

BRepPrimAPI_MakeBox box1(gp_Pnt(-1,0,0),gp_Pnt(0,3,1));
BRepPrimAPI_MakeBox box2(gp_Pnt(0,0,-1),gp_Pnt(1,2,0));
BRepPrimAPI_MakeBox box3(gp_Pnt(-1,0,-1),gp_Pnt(0,1,0));

TopoDS_Shape shape = box1;

shape = BRepAlgoAPI_Fuse(shape,box2);
shape = BRepAlgoAPI_Fuse(shape,box3);

manuel gamito

samuel's picture

when 2 shapes have common faces, CSG operations (cut, fuse, common) have a bug;
try to introduce a little error to have differents faces between the shapes

m-gamito's picture

The thing is, I am using OpenCascade straight off the CVS server. There is a CVS entry for 10/12/01 which, according to the logs, should have corrected this bug for the Fuse of coplanar faces. Apparently the bug is still there, albeit in a more disguised manner.

manuel gamito

Jérome Dufaure's picture

i have the same problem with BRepAlgoAPI_Fuse
now i use BrepTools_Sewing.
method Add() is used to load TopoDS_Shape and Perform() to compute.
SewedShape method returns the result and for me it's OK.
for more details read the BrepTools_Sewing.cdl file.
good luck

peter kurnev's picture

Try to use dev version of Open Cascade.

Draw commands for your case are:
>box b1 -1 0 0 1 3 1
>box b2 0 0 -1 1 2 1
>box b3 -1 0 -1 1 1 1
>bfuse r b1 b2
>bfuse r1 r b3

r1 is resulting shape (shape).