AIS_InteractiveContext->Display() problem with edge created from section

in my application I need to create sections between compound shape (from iges) and a planar face. I'm using OCCT6.2

With some iges all works in the right way. However with complex file i get a "freezing" problem during the edge Ais_InteractiveShape display.

My display code:

Handle(AIS_Shape) ais6 = new AIS_Shape(S3);
if (!ais6.IsNull())
myAISContext->SetColor(ais6, color,Standard_False);
myAISContext->SetTransparency(ais6,myTransparency,Standard_False); myAISContext->Display(ais6,Standard_False);//Here the code "freeze"

Section creation code:
BRepAlgo_Section section(toCut,cutter,Standard_False);
//BRepAlgoAPI_Section always fail...
//BRepAlgoAPI_Section section(toCut,cutter,Standard_False);

if (section.IsDone())

I do:
-ShapeFix_Shape after iges import.
-ShapeFix_Edge after section creation
-Extracting the Handle_Geom_Curve from edge TopoDS_Edge and create a new TopoDS_Edge from that curve

Any hint?

Marco Matt's picture

try to use intersection (GeomAPI_IntSS) between your compound and the plan instead of section.

Davide Canalia's picture

I have a compound shape, so it is composed of a lot of surfaces.
I need to cut all the model with one plane.. GeomAPI_IntSS can work with compound surfaces?

Marco Matt's picture

I never used it with compound, but it should work with any two couple of TopoDS_Shape.

Davide Canalia's picture

I used the followinf solution:
1) extract from the compound only the Face object
2) build a new compound with the Faces from step 1
3) run the BRepAlgoAPI_Section
4) build one (or more) wire from the Edges creted by step 3

step 1 is mandatory (in my current experience) to use BRepAlgoAPI_Section succesfully