Part.BezierCurve.setPoles Point Limit

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
jmwright
Posts: 75
Joined: Thu Jun 19, 2014 2:30 am

Part.BezierCurve.setPoles Point Limit

Postby jmwright » Fri Apr 03, 2015 9:02 pm

I've been working with the example here: http://www.freecadweb.org/wiki/index.ph ... zier_curve

I can pass up to 26 points, but after that I get an error that only mentions

Code: Select all

geomCurve.setPoles(Points)
What I'm trying to do is convert a long list of X-Y points to a curve (with the curve passing through, or very close to, the points). The list that I'm working with has about 40 points in it. First question is, am I going about this the right way by using a Bezier curve? If so, what's the best way to work around being limited to 26 points with BezierCurve.setPoles?

Thanks
User avatar
shoogen
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: Part.BezierCurve.setPoles Point Limit

Postby shoogen » Fri Apr 03, 2015 9:20 pm

You should consider using a BSpline or a piecewise Bezier curve. Using a single Bezier segment with a degree of 26 is usually not intended.
A bezier curve does not pass through a control points (poles). You should consider using the functions to create either an approximation or an interpolation curve.
jmwright
Posts: 75
Joined: Thu Jun 19, 2014 2:30 am

Re: Part.BezierCurve.setPoles Point Limit

Postby jmwright » Sat Apr 04, 2015 4:15 am

Great, thank you. Using the BSpline is working out much better.
wmayer
Site Admin
Posts: 16841
Joined: Thu Feb 19, 2009 10:32 am

Re: Part.BezierCurve.setPoles Point Limit

Postby wmayer » Sat Apr 04, 2015 7:56 am

FYI, under Detailed Description it is said that the maximum degree is limited 25 (i.e. 26 poles).
jmwright
Posts: 75
Joined: Thu Jun 19, 2014 2:30 am

Re: Part.BezierCurve.setPoles Point Limit

Postby jmwright » Mon Apr 06, 2015 12:23 pm

wmayer wrote:FYI, under Detailed Description it is said that the maximum degree is limited 25 (i.e. 26 poles).
Ok, I didn't find that in my search. Thanks.