how to investigate TopoDS_edge

Hi everyone.

I have a TopoDS_edge exported from IGES file. Is there a way to know the type of this Edge? Arc, line, etc.? And if yes, how will I can get points of that edge besides first and last?

Best regards, Max.

Mauro Mariotti's picture

You can get the curve by BRep_Tool::Curve() and check the type by DynamicType() or IsInstance()

Timo Roth's picture

Alternatively, you can use the GetType mehtod of BRepAdaptor_Curve to get to know the curve type.

For getting points of an edge you can use BRep_Tool.Curve(E, First, Last) to get a Geom_Curve from the edge and then use the Geom_Curve.Value(u) method to get points. Take into account that the iso parameter u is bound by the First and Last parameter you received from BRep_Tool.Curve.
You can also have a look at GCPnts_AbscissaPoint.