How to determine Knots and Multiplicities in creating Geom_BSplineCurve?

In AutoCAD, Rhino and other designing tools, we should only set the control points and degree of B-spline curve.
But it needs Knots array and Multiplicities array to create Geom_BSplineCurve.
The question is how to determine the Knots array and Multiplicities array according to given control points(Poles in Geom_BSplineCurve constructor).
Does OpenCascade provide any methods to create B-spline curve as AutoCAD does?
I know Hartley-Judd algorithm but this algorithm seems not to match the condition 'Poles.Length() == Sum(Mults(i)) - Degree - 1 >= 2'.

Alright I found a same question( with incomplete example code. Hope it helps.

Mikhail Sazonov's picture

OCCT has the class GeomAPI_PointsToBSpline for such need.