Mobile app version of vmapp.org
Login or Join
Correia448

: How to determine optimal location of Bezier curve anchor points? To draw this apple using (cubic) Bézier curves, the location and number of the anchor points can be varied: (Apple image: Source)

@Correia448

Posted in: #BezierCurve

To draw this apple using (cubic) Bézier curves, the location and number of the anchor points can be varied:


(Apple image: Source)

The two curves cover the apple with some degree of accuracy, they are not perfect and I'm sure there is a better combination.

Overall:


How the point locations should be determined to keep their number optimal?
In the case of this apple, is there an obvious better solution?


Links to reference material are welcome.



The curves have been drawn using Inkscape.

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Correia448

2 Comments

Sorted by latest first Latest Oldest Best

 

@Berryessa866

you can follow these steps:

1) collect point locations along the curve

2) write a linearized notation of the Bezier curve equation, which will lead you to an over-determined system, that is, there are more equations than variables

3) use ordinary least square to calculate for the control points

4) (optional) clamp the end point to the curve

i've tried it, it worked great. here is the picture showing the concept, the script is in Python though.



i have 4 curves, and want to fit with a Bezier patch (2D or 3D) rather than 1D, but they are all the same approach. i use 8 x 3 control points for each direction, and obtain the control points' locations by least square method.

10% popularity Vote Up Vote Down


 

@Gail6891361

A typical strategy, used by many*, is to place points at the curve extrema, as mentioned by @RadLexus , in a comment. Extrema in this case are defined as places where the curve meets your paper orientation in 0 or 90 degree.



Image 1: One good strategy is to place points on extrema

Having more then 90 degrees between points makes it impossible for you to do elliptical (or cicular) shapes as the fit to such shapes starts to dramatically grow just after 90 degrees. So by using this strategy the problem never raises. Nothing says you need to do the 0 and 90 degree, you could do 40&deg and 130° lines, lines but the 0&deg, 90&deg lines are easy to find and usually there is a modifier to keep constrained that way. So if you keep lines at less than 90 degrees apart you should have less problems.

Outside the extrema in 90 degrees you may want to keep the point count as low as possible as more points does not equate to smoother line. Which is why you want to avoid doing by 45 degree increment unless the situation demand's it. Sure you get more control but knowing where to place the curve is not necessarily possible so you get a wobbling line. Another good habit is to cut s shaped curves at the point where the curvature direction changes.

Since your using inkscape you may want to experiment with using spiro curves instead of beziers.

* though i do not use it.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme