Recursive subdivision is not the best way to flatten quadratic Béziers to polylines. Here's a better way: https://raphlinus.github.io/graphics/curves/2019/12/23/flatten-quadbez.html … . Hopefully catnip for my followers who are really into 2D graphics and math.
-
Show this thread
-
Replying to @raphlinus
Wang’s Formula bounds how many levels of subdivision you need to achieve a specified degree of flatness. “Pyramid Algorithms” by Ron Goldman covers Wang’s formula (chap. 5.6.3). Wang’s formula is also discussed in: DEC Paris Research Laboratory report #1, May 1989. Good luck!
2 replies 0 retweets 6 likes -
Replying to @pixelio @raphlinus
Shorter: you can use Wang’s (and successors) for computing the necessary number of line segments for quads, cubics, and even rationals.
1 reply 0 retweets 0 likes -
Replying to @pixelio
I managed to get my hands on the chapter. It's interesting reading, but not an especially tight bound. Generally recursive subdivision is 1.5x the number of segments as optimal.
1 reply 0 retweets 0 likes -
Replying to @raphlinus
Section 10.6 of Sederberg’s “CAGD” course notes (“Error Bounds”) is a little clearer about calculating the number of line segments and not just the subdivision level. It would be be neat to see the line segment count plot between the methods.
1 reply 0 retweets 1 like
Sure, press "s" or "w" to see the Sederberg or Wang solution. Competitive when curvature is near constant, less so when it varies a lot. Thanks again for the references!
-
-
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.