What's new

Uniform Knot Vector Produces Clamped b-Splines

alexfranke

Senior Member
Uniform Knot Vector Produces Clamped b-Splines

Hi all,

I'm trying to implement a closed b-spline by wrapping the first p control points to the past p points and providing a uniform knot vector to [a_valid_sketch].Figures.AddBspline(). However, it appears that when the curve is rendered, it is clamped to the start and end control points, as if the first and last p+1 knots equal to their respective ends of the domain. (Actually it looks like the order of the curve is reduced while approaching the first and last conrtol points so that it's 2 by the time it reaches it.)

For example, where:
order == 4
numPoint == 7
points == {1,1,1,-1,-1,-1,-1,1,1,1,1,-1,-1,-1 }
knots == { 0,1,2,3,5,6,7,8,9,10,11 }
weights == { 0,0,0,0,0,0 }

Any ideas?

Thanks,
Alex Franke
 

shubhab

Member


Hi Alex,

Can you upload the file with the BSpline in it (The result you get with the values you have used)? This will help me in knowing more about this issue.

Thanks,
Shubha Bhat
Alibre, Inc.
 

alexfranke

Senior Member


No problem, Shubha. File is attached.

This uses the data in my previous post, except there was a typo in the knot vector. I had mistakenly skipped the number 4. The corrected array { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 } was used for this example.

Overlapping p control points like this should crete a circle. (Curves or lines should not extend to the starting and ending control points.)

Thanks for you help on this!

Cheers,
Alex
 

Attachments

  • UniformKnotVector.zip
    6.7 KB · Views: 4

shubhab

Member


Hi Alex,

I looked at your file and discussed this issue with our Development Manager.
It looks like you are trying to sketch a non-clamped BSpline.
We only support non-periodic or the Clamped BSplines. In fact most of the CAD Applications in the market also support only these kinds of BSplines.
However, if you provide appropriate Weights and Control points to the Clamped BSplines, you should be able to achieve the result you are expecting.

Thanks,
Shubha,
Alibre, Inc.
 

alexfranke

Senior Member


Thanks, Shubha.

The request originated from a user who wanted to use my Point Import Wizard (which places points as b-spline curves) to place a closed loop b-spline that is "smoothed" where it's joined so that actually none of the curve passes through any control point. (The circle was the most basic example.)

I'll have to experiment a bit to see if I can produce this result by recalculating some control points and weights.

I suppose I could get the same end result by clipping off the line segments that extend out to the start and end control points, but I don't think that's possible through the API.

I'll add some version of this to the enhancement thread...

Cheers,
Alex
 
Top