separating arc and line

hi
my TopoDS_Shape i have exploded it in to TopoDS_Edge. now i want to separate arc, circle and line. i mean how can i recognize data i have collected in topods_edge is a line or a arc or a circle. and also by some mean if could do it then how should i collect it in a object of gp_Circ etc...

wishing positive reply...

thanks in advance........

Rob Bachrach's picture

You might want to check out: http://www.opencascade.org/org/forum/thread_11187/

In general, you get the underlying curve and compare the type to decide how to cast the result.

Svetlozar Kostadinov's picture

Use BRepTool::Curve() then check the type of the result with DynamicType(). I think this is what you need.

Regards!

ziyoo's picture

// edge: your TopoDS_Edge
BRepAdaptor_Curve cons;
if (BRep_Tool::SameParameter(edge))
{
cons.Initialize(edge);
}
else
{
cons.Initialize(edge, face);
}

switch(cons.GetType()){
case GeomAbs_Line:
break;

case GeomAbs_Circle:
break;

case GeomAbs_BSplineCurve:
{
break;
}
case GeomAbs_BezierCurve:
{
break;
}
default:
}