Mon, 07/16/2018 - 23:56

Hi All,

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.

Jim

Tue, 07/17/2018 - 09:06

Hi Jim,

if you talk about spline interpolation AFAIK you always use all support points - no matter whether you need them or not. An alternative could be curve approximation with GeomLib::BuildCurve3d(...). If you have two spline interpolations that have different support point numbers but are geometrically the same, I guess that their approximation curve should be identical.

Benjamin

Tue, 07/17/2018 - 19:17

Hi Benjamin,

Thanks for your comments. I was talking about spline approximation. It is definitely reasonable (and expected) that all support points (i.e. the input 3D points I guess) are used during the fitting of a b-spline curve. What I didn't expect was that the properties such as the poles... of the resulting b-spline are so closely related to the number of the input points when using GeomAPI_PointsToBSpline. In linear algebra, when fitting a set of points into a line, we would get the same (or very similar) linear equation whether you are using 5 or 6 points (let's say we sample the same data twice). I was hoping to get a similar result when it comes to b-spline fitting of 3D points in OCC.

Can you please elaborate a bit more on how to use GeomLib::BuildCurve3d in this case?

Thanks,

Jim

Wed, 07/18/2018 - 10:08

I use it like this:

The variable curveToApproximate is the curve to approximate and the variable result will contain the approximation.

Benjamin

Wed, 07/18/2018 - 18:07

Thanks, Benjamin. It seems the raw data was not "curve on surface" in my case. I will give a try. Thank you again.

Mon, 11/05/2018 - 10:24

Hi Jim,

I am sorry. Just now I have realized that I have proposed a class that is only usable for curves on surfaces.

Still there might a possibility to such a curve approximation like that:

Benjamin