|different behaviour of "fuse" in test harness and API
I just started working with OCC 5.1 and tried some "easy" boolean operations (fusions).
When I do the following in the test harness (XSDRAWEXE) the result is what I was expecting.
Draw> box b1 50 50 20
Draw> box b2 20 20 50
Draw> fuse s1 b1 b2
Draw> ttranslate s1 60 0 0
==> the translated solid s1 has exactly 9 faces (side faces are unioned to a face with "L"-shape)
Now I tried to make the same with the API:
TopoDS_Shape theBox1 = BRepPrimAPI_MakeBox(50,50,20);
Handle (AIS_Shape) ais1 = new AIS_Shape(theBox1);
TopoDS_Shape theBox2 = BRepPrimAPI_MakeBox(20,20,50);
Handle (AIS_Shape) ais2 = new AIS_Shape(theBox2);
//fuse box1 and box2
TopoDS_Shape FusedShape = BRepAlgoAPI_Fuse(theBox1,theBox2);
Handle (AIS_Shape) aFusion = new AIS_Shape(FusedShape);
TopoDS_Shape FusedShape2 = myBRepTransformation2.Shape();
Handle (AIS_Shape) aFusion2 = new AIS_Shape(FusedShape2);
Unfortunately now the faces at the side are not unioned! The result is a solid with 12 faces.
Where is the problem? Most of the source code I copied from the delivered OCC-MFC-examples.
I already looked through the forum and found some curious information about similar themes. But I can not believe that OCC is not able to union two solids together without union all faces. Unioning a cube1 (5x5x5 at pos 0,0,0) with a cube2 (5x5x5 at pos 5,0,0) must result in a new cube3 (10x5x5 at pos 0,0,0) with 6 faces.
Or do we really have to union these faces by ourself like I read in some topics??? I just don't want to even think about that!
Any help is very much appreciated.
|Test harness comand 'fuse' uses the old boolean API "BRepAlgo_Fuse" class. BRepAgloAPI_Fuse/new BOP has this behaviour. Is it possible to get ( any parameter/setting) such an output as this is the expected output in most CAD kernel's/system's worldwide. |