Search code examples
opencascade

Retriving IGES entity 126 properties from a TopoDS_Edge object of type GeomAbs_BSplineCurve


An IGES entity 126 has a property or flag 3 value of 0 = rational or 1 = polynomial. After converting the entity to TopoDS_Edge, how do you retrieve the flag value? Or, if possible how do you check whether a bspline curve gives us a straight line or otherwise?


Solution

  • This worked for me I found the IsRational() function. I hope this is the proper use:

    TopoDS_Edge edge = TopoDS::Edge(shape);
    BRepAdaptor_Curve curve = BRepAdaptor_Curve(edge);
    bool isrational = curve.IsRational();
    

    Better solutions are still welcome. :)