Extracting Wire from a given Face

Hi,

I would like to extract the outer wire of a planar face. I looked at TopExp_Explorer but that does not retreive wires. My next idea, TopoDS::Wire expects a TopoDS_Shape as a Parameter, so that one is not viable, either.

I think i need a nudge in the right direction...

thank you
Til

Tilman Leune's picture

I found a solutution using TopoDS and TopExp_Explorer O_o

Code:

BRepBuilderAPI_MakeWire wireMaker1;
for(TopExp_Explorer edger(aFace, TopAbs_EDGE);edger.More(); edger.Next())
{
wireMaker1.Add(TopoDS::Edge(edger.Current()));
}
wireMaker1.Build();
TopoDS_Wire aWire1 = wireMaker1.Wire();

tmacedo29's picture

Hi Tilman Leune,

try to search about BRepTools::OuterWire.

I hope it will help you.
Regards,

Tilman Leune's picture

Thanks a lot!

Not only is my codes reduced from 7 lines to 2,

it also is faster by a power of 10: 0.02 ms with my approach and 0.002 ms using the Outerwire function.