Hi
Mathematically every curve has its own fixed degree depending upon the degree of the equation representing it. However, curves that are created using polylines (Beziers, B-Splines etc.) allow you to modify the number of points in the descriptor polygon which effectively changes the class and degree of the curve albeit the shape is changed too.
OpenCASCADE allows to insert and remove points from the descriptor polyline and thus modify any Bezier or B-spline curve.
You can look at:
Approx_Curve3d
Handle_BRepAdaptor_HCompCurve
BRepAdaptor_HCompCurve
the following code take the wire's curve and approx it to a given degree (it also create a single curve if the wire is composed by different edges)
BRepAdaptor_CompCurve bac(wire);
Handle_BRepAdaptor_HCompCurve hccurve=new BRepAdaptor_HCompCurve(bac);
// approximate the curve using a tolerance
Approx_Curve3d approx(hccurve,tol3D,GeomAbs_C2,maxSegment,maxDegree);
if (approx.IsDone() && approx.HasResult())
{
// have the result
curve=approx.Curve();
}
}
Wed, 01/30/2008 - 10:47
Hi
Mathematically every curve has its own fixed degree depending upon the degree of the equation representing it. However, curves that are created using polylines (Beziers, B-Splines etc.) allow you to modify the number of points in the descriptor polygon which effectively changes the class and degree of the curve albeit the shape is changed too.
OpenCASCADE allows to insert and remove points from the descriptor polyline and thus modify any Bezier or B-spline curve.
Regards
N. Sharjith
Wed, 01/30/2008 - 17:49
You can look at:
Approx_Curve3d
Handle_BRepAdaptor_HCompCurve
BRepAdaptor_HCompCurve
the following code take the wire's curve and approx it to a given degree (it also create a single curve if the wire is composed by different edges)
BRepAdaptor_CompCurve bac(wire);
Handle_BRepAdaptor_HCompCurve hccurve=new BRepAdaptor_HCompCurve(bac);
// approximate the curve using a tolerance
Approx_Curve3d approx(hccurve,tol3D,GeomAbs_C2,maxSegment,maxDegree);
if (approx.IsDone() && approx.HasResult())
{
// have the result
curve=approx.Curve();
}
}