Jump to content
TomoftheDay

Is it possible to Override the Maximum Degree of a B-Spline?

Recommended Posts

Hi There,

The maximum degree of an FBSplineCurve type appears to be limited to 9.
I am producing curves with many more points than 10, is it possible to override this maximum and apply my own limit so that the degree may be correct to the number of points?

Share this post


Link to post
Share on other sites

Hi,

Typically, a B-spline curve of a 3rd degree provides sufficient smoothness for engineering applications, with the number of control points being independent of the curve's degree. This configuration allows for localized control over the curve by adjusting individual control point positions.

In contrast, the number of control points in a Bezier curve is directly tied to the curve's degree. This affords global control over the curve, meaning altering a control point's position affects the curve's shape across its entirety, which may not always be desirable.

In conclusion, increasing the degree of a curve beyond 9 introduces computational complexity that is unnecessary for practical engineering purposes.

Best Regards,

Andreas

Share this post


Link to post
Share on other sites

Hi Andreas, Thanks for your response.

I'm elevating to high degrees for the purpose of G2 curvature continuity and to ensure very low deviation from a lower-order non-continuous basis curve.
Control point positions are automated and I am not concerned with increased computational load/complexity.
I do have a reason to want to do this.

I know that Rhino can natively compute Bezier curves up to the 12th degree, and I am wondering if it is possible to lift or be above this limit in CAESES.

Thanks,
Tom

Share this post


Link to post
Share on other sites

Hi Tom,

technically for B-Spline and NURBS curves the degree can be up to number of points minus 1 (in CAESES it is indeed currently limited to 9 though). For G2 a degree of 3 is all that is needed. With 4 you can already get continuity in the change in curvature... Personally, I rarely go higher than 4 or 5.

Maybe the question is what you intend to do (you wrote that you want to get close to a given curve. However by increasing the degree you get the opposite: a degree of 1 still interpolates the control points. When increasing it, you get further and further away from it (and, as Andreas pointed out, trade local control for global a one).

If you want a good approximation you can try some of the following options:

1. A C-Spline (this is an approximation of a point cloud and you are free to choose the number of points and degree (still 9 is the limit)). Prone to oszillations.

2. A generic curve that reproduces another curve but has a limited number of control points. That is a nice trick but no tangent information at the ends are taken into account. But that can be fixed.

3. An approximation curve (there is an operation called approximate by tolerance). Relatively new type, I like it a lot because it let's you choose tangents and degree. Results in very accurate approximations with only a few control points. Only downside: it will not give you a distinct number of points.

4. An interpolation through a number of points on the original curve (operation called approximate by point interpolation). Depending on the number of points and chosen interpolation method the results may differ. 

5. Depending on the actual problem you are facing, typically you can get the best results if you re-model curves (potentially piece-wise) and capture the design intent. An F-Spline often times works wonders here (i.e. keep the original tangents, maybe even curvature at the ends and same area under the curve --> this will typically leave you with a very similar shape but perfect smoothness since the F-Spline is fairness-optimized)

If you post your project or a sreenshot of the curve you want to approximate I may be able to give a more targeted advise. If you really just need a degree higher than 9 I can touch base with the dev team and see if they can make it happen.

Cheers,
Heinrich

Share this post


Link to post
Share on other sites

Hi Heinrich,

Thanks for your insight, I really appreciate all of your recommendations, very useful for the future!

This was for a piece of University coursework, which I have submitted so this is now a low priority issue for me.
Although I think being able to override the maximum number of degrees may be a useful feature, if all of the caveats laid out by Andreas are understood.

I'll paste the question here, upload my file, and explain my reasoning below.

image.png.39121d3aa7c55eb9ee74a01246c67df4.png

image.png.2713f1f70d79c33d1a4e917169492b2f.png

  • I have three Bezier curves which are joined to form a composite Bezier curve: a straight line, a 4th degree curve, and another straight line.
  • The 4th degree curve has G0 & G1 continuity with the straight lines.
  • The task is to augment the 4th degree curve to obtain G2 continuity with the straight lines at either end of it.
  • Based on the other questions asked and the teaching given, the intent is for the degree of the curve to be elevated and the new control points augmented to give G2 continuity.

My method to achieve this is as follows:

  • I interpolate the 4th degree curve to calculate the new control points necessary for degree elevation, this is handled by the feature script 'BezierDegreeElevation' in the attached file. This results in a curve with n additional control points which is identical to the original curve.
  • However if the curve degree is elevated above 9 there are some discrepancies due to the curve degree hard limit. 
  • I can then align the appropriate points to gain G2 continuity. Handled by 'AlignCurveToOrthoPosG2' in the file.
  • This results in an augmented curve which is no longer similar to the original basis curve.
  • If I were to further increase the degree of the curve before aligning the points, the resulting augmented curve would better approximate its basis curve.
  • Hence the desire for further degree elevation.

I can show this with the following handy graph which illustrates the reduction in deviation due to degree elevation, this uses data from the feature 'evalMaxDeviationBeteweenCurves' from the file.

image.png.bbe08fede3d1c4ab7b9ad5aba48052b4.png 

I appreciate that this is a very specific case, though I could envisage scenarios where a designer may want to augment a curve for continuity reasons, and then closely approximate that basis curve. Particularly in the marine hullform design space.

Many Thanks,
Tom

Q2.cdbc

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...