Does any operation support to elevate or decrease the degree of a curve?

Thanks in advance. Any suggestion is welcome.

Sharjith Naramparambath's picture

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

Davide Canalia's picture

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();
}
}