I am using GeomAPI_PointsToBSpline to fit a set of 3D points into a b-spline curve and the result looks reasonably well (Thanks to Roman for his comments). During the process, I found a pretty interesting thing: the number of poles of the resulting b-spline curve is always similar (or equal) to the number of the raw points (keep the rest of the parameters the same for GeomAPI_PointsToBSpline's constructor). This leads to a problem: the fit b-spline curve would have different set of poles, knots...with different sampling rates of raw data. For example, for the same nominal curve, I would get two different set of poles, knots..., for the actual curve (fit curve), when I have 20 or 25 raw points, even if the two actual curves visually look almost identical.
My understanding (my hope) was, if I keep the rest of parameters such as degrees, tolerance, continuity... the same, the shape of the b-spline should be decided by the poles, and if the final shape of the b-spline is similar, the poles should be similar (at least, the number of poles should be the same). Apparently OCC didn't do that way. Is this possible to achieve in OCC?
Any suggestions will be greatly appreciated. Thanks.