I have a question about calculating the bezier controls for a curve. The problem is as the following image shows:
I have the red points in an ordered list, including C and D. I need to find F and E. The problem is that not every point has to be on the curve (the curve does not need to pass through any point, except for start and end). It just has to be an "approximation".
I've already read about the following:
- Finding the control point of bezier curves - only works with horizontal aligned handles, I don't have a midpoint to start from. Does also only find the user-visible control points, not F and E
- Parametric reconstruction of a NURBS curve - that's fine if you want to interpolate between the red points, but that's not my goal
So my thought on how to solve this was:
- Calculate the furthest point from a line through C and D
- If the number of points is even, look at the previous and next point in the list, determine which one is further away from the imaginary line and calculate the midpoint between them
- Three points are not enough to get the shape of the curve, I need the value at 25% and 75%. Luckily there are several methods for determining this: uniformly spaced method, arc length and centripedal method.
- Now I have 5 points (begin, 25%, mid, 75%, end) to describe my curve. I know the t values for each one. The curve should look like this:
From this, I need to somehow insert the points into the bezier formula and then reverse-calculate the control points ... how?
Thanks in advance for any hints.