
Fri, 12/14/2007 - 07:51
Forums:
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........
Fri, 12/14/2007 - 14:55
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.
Fri, 12/14/2007 - 20:36
Use BRepTool::Curve() then check the type of the result with DynamicType(). I think this is what you need.
Regards!
Sat, 12/15/2007 - 04:28
// 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:
}