BRepAlgoAPI_Section undelying shape

Hi folks!

I am trying to use a section of two TopoDS_Shapes for a subsequent extrusion.

Here is what is working so far:

BRepAlgoAPI_Section section(current_topo_shape,Evolved,PerformNow);
section.ComputePCurveOn1(Standard_True);
section.Approximation(TopOpeBRepTool_APPROX);
section.Build();

current_topo_shape is a shape from the AIS context and Evolved is in this case a simple rectangular block.
If I call section.Shape() I can display the section on the AIS_Context.

What am I receiving when I call section.Shape()?

Trying to extract the wire of the section does not work:

for (TopExp_Explorer wireEx (section.Shape(),TopAbs_WIRE);wireEx.More();wireEx.Next()){

Evolved = BRepOffsetAPI_MakeEvolved (TopoDS::Wire(wireEx.Current()) ,aWire3,Join,AxeProf,Solid,ProfonSpine,Tol);

Handle(AIS_Shape) aEvolved = new AIS_Shape(Evolved);
if (!aEvolved->IsKind(STANDARD_TYPE(AIS_Shape))) //skip
continue;
myAISContext->Display(aEvolved,Standard_False);
OCC_3dBaseDoc::Fit();
Sleep(500);
}

Francois Lauzon's picture

Hello,
> What am I receiving when I call section.Shape()?

you could find your answer in the documentation file BRepAlgoAPI_Section.cdl:

-- The result (Shape() method) is a compound containing
-- edges built on intersection curves.

Good Luck,
Francois.

Udo's picture

Thanks Francois!

But why is my edge explorer then finding NULL objects?

for (TopExp_Explorer edgeEx(section.Shape(),TopAbs_EDGE);edgeEx.More();edgeEx.Next()) {
TopoDS_Edge tmpEdge = TopoDS::Edge(edgeEx.Current());
if(tmpEdge.IsNull){
TRACE0("Edge is null!\n");
continue;
}
}

Regards,

Udo

Francois Lauzon's picture

Hello Udo,
I can't see why, unless there is a bug in the TopExp_Explorer with your particular shape... because if you enter the loop, it's because the edgeEx.Current() is an edge, unless I'm missing something. Maybe you could send me your brep file of the section...

Good Luck,
Francois

Udo's picture

Hi Francois,

Thanks for your answer. I was away for a while, thats why I get back to the subject now. Where can I send the brep file?

Regards,

Udo

Francois Lauzon's picture
Volker's picture

Hi,
I have a very similar problem and by searching this forum I found out that there seem to be some more people with problems using BRepAlgoAPI_Section.
I use a disk (circle shaped face) for calculating a point on a surface with given distance in a given direction.
In some cases no intersetions are found. Visualizing the objects shows there obviously should be.
A hint from Neil (Message at 2002-02-26 12:58) gave me a workaround (changing the order of the faces) but I'm afraid this is a bug in BRepAlgoAPI_Section.

Best regards

Volker