Open CASCADE, the 3D modelling kernel
3D modeling & numerical simulation

Search the Forums
See All Topics
 

different behaviour of "fuse" in test harness and API

different behaviour of "fuse" in test harness and API
Mirko 2004/05/03 17:08
Hi,
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[1]> box b1 50 50 20
Draw[2]> box b2 20 20 50
Draw[3]> fuse s1 b1 b2
Draw[4]> ttranslate s1 60 0 0
Draw[5]> fit
==> 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:

//box1
TopoDS_Shape theBox1 = BRepPrimAPI_MakeBox(50,50,20);
Handle (AIS_Shape)     ais1 = new AIS_Shape(theBox1);
myAISContext->SetCurrentObject(ais1,Standard_False);

//box2
TopoDS_Shape theBox2 = BRepPrimAPI_MakeBox(20,20,50);
Handle (AIS_Shape)     ais2 = new AIS_Shape(theBox2);
myAISContext->SetCurrentObject(ais2,Standard_False);

//fuse box1 and box2
TopoDS_Shape FusedShape = BRepAlgoAPI_Fuse(theBox1,theBox2);
Handle (AIS_Shape)     aFusion = new AIS_Shape(FusedShape);

myAISContext->SetDisplayMode(aFusion,1,Standard_False);
myAISContext->SetColor(aFusion,Quantity_NOC_RED,Standard_False);
myAISContext->SetMaterial(aFusion,Graphic3d_NOM_PLASTIC,Standard_False);
myAISContext->Display(aFusion,Standard_False);
myAISContext->SetCurrentObject(aFusion,Standard_False);
Fit();

//transform union
gp_Trsf theTransformation2;
gp_Vec theVectorOfTranslation2(70,0,0);
theTransformation2.SetTranslation(theVectorOfTranslation2);
BRepBuilderAPI_Transform myBRepTransformation2(FusedShape,theTransformation2);
TopoDS_Shape FusedShape2 = myBRepTransformation2.Shape();
Handle (AIS_Shape)     aFusion2 = new AIS_Shape(FusedShape2);

myAISContext->SetColor(aFusion2,Quantity_NOC_BLUE1,Standard_False);
myAISContext->SetMaterial(aFusion2,Graphic3d_NOM_PLASTIC,Standard_False);
myAISContext->SetTransparency(aFusion2,0.5,Standard_False);
myAISContext->Display(aFusion2,Standard_False);
myAISContext->SetCurrentObject(aFusion2,Standard_False);
Fit();

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.
Cheers,
Mirko
PG 2012/08/18 07:38
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.

- PG
 
 
Latest news
  • OCCT Applications
  • Open CASCADE Technology 6.8.0 is available for download!
  • New features to enhance the development process

  • © OPEN CASCADE 2000 - 2014  |  Search  |  Contacts   |  Site map