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

Search the Forums
See All Topics
 

Error boolean common

Error boolean common
MIke 2012/11/08 00:36
Hi,
I have two IGES-files. I read this and than I use the brepalgoapi:

BRepAlgoAPI_Common algoOp = BRepAlgoAPI_Common(Shape1, SHape2);
     cmp.Build();
     TopoDS_Shape ShapeResult=cmp.Shape();

The problem is that I get this error:
-          ShapeResult{myTShape={...} myLocation={...} myOrient=TopAbs_FORWARD }     TopoDS_Shape
jelle 2012/11/08 01:25
If you expect a meaningful reply, than you probably need to share the CAD files [ also check if you can share the data publicly... ]
MIke 2012/11/08 13:27
I don't know what you mean ... I have to simple files and can't use boolean COMMON. My second problem is the color.

// Function to load IGES
          TopoDS_Shape aIGES1= readIGES("file1.igs");
          TopoDS_Shape aIGES2= readIGES(file2.igs);

          //boolean common
          TopoDS_Shape aresult= booleanCommon (aIGES1, aIGES2);

          // CREATE DOCUMENT AND APPLICATION
          Handle(TDocStd_Document) aDoc;
          Handle(XCAFApp_Application) anApp = XCAFApp_Application::GetApplication();
          anApp->NewDocument("MDTV-XCAF",aDoc);
          // CREATE A LABEL AND ADD A SHAPE TO IT
          Handle (XCAFDoc_ShapeTool) myShapeTool = XCAFDoc_DocumentTool::ShapeTool(aDoc->Main());
          TDF_Label aLabel = myShapeTool->NewShape();
          myShapeTool->SetShape(aLabel,aresult);

          // ADD COLOR TO THE LABEL
          Handle(XCAFDoc_ColorTool) myColors = XCAFDoc_DocumentTool::ColorTool(aDoc->Main ());
          Standard_Real r=1;
          Standard_Real g=0;
          Standard_Real b=0;
          Quantity_Color theColor(r,g,b,Quantity_TOC_RGB);
          myColors->SetColor(aLabel, theColor, XCAFDoc_ColorGen);

          // WRITE THIS DOCUMENT AS A IGES FILE
     IGESCAFControl_Writer *myWriter = new IGESCAFControl_Writer();
myWriter->Perform(aDoc,"file_resukt.gis";
James D. 2012/11/11 14:13
No I do not have CAD Data . I have online the iges-files. I can cut or fuse the objects, but intersection does not work.
 
 
Latest news
  • Open CASCADE Technology 6.8.0 is available for download!
  • New features to enhance the development process
  • Open CASCADE Technology 6.7.1 is available for download!

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