How can I differentiate between an full circle and an arc of the same support circle?
I'm trying to cycle through the elements of a TopoDS_Shape of type TopAbs_COMPOUND.
Everything just work fine using the below code:
I can use u0 and u1 values to decide it. If 0 to 2*PI - is a circle, otherwise if 0 to <2*PI is an arc.
My question is whether there is a more elegant method (as it should have been IsClosed() ) than the raw checking of the values of the parameters u0 and u1.
Thank you!
I'm trying to cycle through the elements of a TopoDS_Shape of type TopAbs_COMPOUND.
Everything just work fine using the below code:
Code:
double u0, u1;
Handle(Geom_Curve) Curve;
TopoDS_Edge Edge;
Curve = BRep_Tool::Curve(Edge, u0, u1);
GeomAdaptor_Curve brepCurveAdaptor(Curve);
GeomAbs_CurveType curveType = brepCurveAdaptor.GetType();
switch (curveType)
{
case GeomAbs_Circle:
{
if (Curve->IsClosed())
{
// here the code always runs no matter is an arc or a circle
}
}
}
I can use u0 and u1 values to decide it. If 0 to 2*PI - is a circle, otherwise if 0 to <2*PI is an arc.
My question is whether there is a more elegant method (as it should have been IsClosed() ) than the raw checking of the values of the parameters u0 and u1.
Thank you!
Last edited: