Obtain the shape of the TopoDS_Edge,such as curve, line or circle

Holle,

I don't know how to distinguish the specific shape of TopoDS_Edge that I picked up with the mouse, such as curve, line or circle?

Thank you!

luzius.koelling_152465's picture

Hi, I don't understand exactly what you are trying to do, but a TopoDS_Edge is a topologic element based on a geometric curve. You could obtain the Geom_Curve by using BRep_Tool::Curve(). Then maybe you can determine the type of Geom_Curve, such as Geom_Line or Geom_Circle.

1015635081_158269's picture

Thanks for your reply.

I tried this method and found that I could only tell the Geom_BSplineCurve, but nothing happened to the Geom_TrimmedCurve.I don't know why.

TopoDS_Shape& aS;

double dF,dL;

Handle(Geom_Curve) aCur = BRep_Tool::Curve(TopoDS::Edge(aS),dF,dL);

if(aCur->IsKind(STANDARD_TYPE(Geom_BSplineCurve)))   //It works here

{

...

}

else if(aCur->IsKind(STANDARD_TYPE(Geom_TrimmedCurve))) //but It doesn't work here 

{

}

Thomas Anderson's picture