Sign in to follow this  

Scale bezier curve along normal

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi!

I want to resize a bezier curve along its normals in order to resize a free form shape. I want to resize the object, but not _scale_ it.

What i do right now is the following:

Take the set of control points
Calculate the normal on the tangent points
Add normal * size to the control points

Of course, this doesn't work exactly as it should. The tangents should be changed, but i don't know how. Right now, my shape (that is tesselated later) looks like it is liquified :)

Any idea?

My control point setup gives me a point, and a tangent in, and tangent out value (defining the other 2 control points). But if i add the normal to these points, they get eased out, as they are handled as tangents and the original point is already translated. I hope you can follow me...

I also tried to tesselate first and move every vertex along its vertex normal, but this gives me intersections pretty soon.

Thank you very much, any help is appreciated and i am happy to share a working solution as soon as i get there...

snow

Share this post


Link to post
Share on other sites
The name of the curve you're trying to find is an offset curve. Here's what I found about calculating those with a quick google search:
[url="http://processingjs.nihongoresources.com/bezierinfo/#offsets"]http://processingjs....erinfo/#offsets[/url]

I had to do this for quadratic bezier curves to implement stroking in my vector graphics library, and it was easy enough.

I started by using the same method as you (shifting control points along normals), which gives a good approximation when the curve is flat enough. When it isn't, you get the right distance at the extremities but much less than it at the center. Fortunately it is easy to solve by calculating the distance between the middle point of the original curve and of the approximate offset curve. If this distance is too far from the one you want, you just split the original curve in two and redo all this recursively.

It is probably more complicated for higher order curves, though. Edited by Zlodo

Share this post


Link to post
Share on other sites

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

If you intended to correct an error in the post then please contact us.

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

Sign in to follow this