Retrieving the holes in a TopoDS_Face

Hello all,

Is there any way to parse a TopoDS_Face to retrieve the boundary of the face itself and the boundaries of the holes it contains?

Thanks,
Ian

Alexander Luger's picture

I think you are looking for the class ShapeAnalysis_FreeBounds (GetClosedWires()).

Regards,
Alex

Ian Clévy's picture

Thanks.

GetClosedWires only returns the holes, right?

For the face itself I should use ShapeAnalysis::OuterWire, right?

Ian Clévy's picture

Scrap that...the outer wire was open :)

Alexander Luger's picture

For the outer wire you can also use BRepTools::OuterWire().

Regards,
Alex

Ian Clévy's picture

ShapeAnalysis_FreeBounds:GetClosedWires() now also returns the outer boundaries because I closed it. Is there any way to differentiate the outer bounds from the holes? At first I assumed the outer bounds was just the first wire in the compound, but I have found that it is not always so.

Do I have to get the outer bound using BRepTools::OuterWire() and then test a match in the compound returned by GetClosedWires? Or is there another method to find out which wires are the holes?

Ian Clévy's picture

My method of testing the DRepTool::OuterWire with the wires in the resulting compound of GetClosedWires doesn't work: for some reason the wire returned by BRepTools::OuterWire can't be found in the compound. Both isSame() and isEqual() return false on all the wires in the compound.

Does anyone have a better method for finding the holes and boundaries of a face?