# NURBS curve u spacing

This topic is 4996 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I'm writing some basic NURBS routines and am running into a small problem getting regular spacing of the points generated along the curve's u direction. I increment u by the same amount each time, but the spacing is different toward the two ends of the curve than at the center. This uneven spacing only happens when I deal with nonlinear (degree greater than 1) curves. So for example, a degree 1 curve, when sampled at 5 evenly-spaced u divisions, looks like this when rendered as points: ..... When this same curve is raised to degree 3, the u divisions are no longer evenly spaced: . ... . The only time I can get perfectly even spacing on a nonlinear curve is if the number of u divisions is equal to the degree of the curve+1. So for example, 4 u divisions on a degree 3 curve looks even: .... I am using a standard knot vector, and the curve is properly interpolating the end points. The only problem is the evenness in spacing. I have tried two different routines to calculate the basis function-derived weights for the control points and got the same exact uneven spacing. So at this point I'm wondering if this is something inherent in the b-spline basis functions (I get the same uneven spacing whether the curves are true NURBS curves or whether they are just basic b-splines, so the weighting is not the problem) and if there is something special you have to do in order to get a nice, even spacing. Thanks!

##### Share on other sites
There is no mathematical way to guarentee equal spacing. This is a property of those algorithms. If you want equal spacing you'll just have to calculate the exact value of u iteratively.

##### Share on other sites
Thanks, Rick!

I went through the calculations for the basis function control point weights by hand and got the same results my code was giving me. So it seems like it's doing what it's supposed to be doing...

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 13
• 14
• 10
• 11
• 13
• ### Forum Statistics

• Total Topics
634096
• Total Posts
3015489
×