2
votes

I am using Bezier curves to plot curves in a program I am making. I have five points. Here is a crude sketch of the curve I am trying to create. I'm trying to make a curve that goes through A,B,C,D. However, C is not a definite point, it is a suggestion of where the curve should pass through to make it look like a French Curve. C comes out from E at 45 degrees.

This is an illustration of what I am trying to do.

Does anyone have any suggestions on how to approximate a French Curve that would go through those points?

4
I don't quite get what you are trying to do. Could you fill in more of the wanted curve in your illustration? - Jonas Elfström
Either it goes through C or it doesn't so please clarify the question. Does it go through E? You say "C comes out from E at 45 degrees." and I can see that from the diagram but why? What's the relationship there? You've also got lines from E to B and from E to D - what are they supposed to be telling us? - Troubadour

4 Answers

3
votes

You need to use a Cubic Bezier. Cubic Beziers are defined by four points, but do not pass through the middle two points, they merely specify a vector for the Bezier. Unfortunately for you, there are an infinite number of Cubic Bezier curves that can go 'through' your four points.

Don Lancaster has written a document (pdf) about this. Which goes into some pretty interesting detail about the algorithms he use. It's in postscript which I doubt you're using, but at least the principals are there.

Here is an article out on CodeProject where they've built a library for doing what you're trying to do with C#.

0
votes

Bezier curves pass through the first and last control point specified, and the interior control points determine the shape. If you make a curve using ABCDE it will not pass through point C. But you could break it into two different curves, introducing a control point before and after C so you have A B B' C and C C' D E. Make B', C, and C' collinear so that the curve will have first order continuity.

0
votes

Given any three non-collinear points (A, B, D), you can draw an arc connecting them.

Given any three or four points you can construct a Bézier curve connecting them that looks rather nice. (You probably do not need to throw in an extra point C just to get the curve to look nice, but of course you can if you want.)

Precisely how to do this depends on the graphics library you're using. So what library are you using?

0
votes

Everything said above is truth,but there is a small trick that i just found about recently.Bezier curves DO NOT pass through control points,execpt p0 and pn (first and last).But there is a formula that enables you to to construct bezier curve through given points.You do that by calculating new "imaginary" control point.Sadly,i only have formula for 2nd degree curves,but im sure it can be generalised.Here it is: NEWPOINT(X)=P1(x)*2-(P0(x)+P2(x))/2 same for Y

this formula gives "new" P1 point (cause p0 and p2 are start and end),and curve pass through "original" P1.Hope that helps?Also use Bernstain polynoms for calculation,thats my advice