We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › LazyWeb Request: Length of a Bezier
Page Index Toggle Pages: 1
LazyWeb Request: Length of a Bezier (Read 466 times)
LazyWeb Request: Length of a Bezier
May 5th, 2007, 12:11am
 
Double Kudos to anyone who's willing to translate one of the following solutions into Processing. The math is _far_ beyond me. A quick Google seems to say Jens Gravesen worked this all out years ago; most recent solutions refer back to him. In any case, these seem to be good starting points:

http://www.acm.org/pubs/tog/GraphicsGems/gemsv/ch4-7/

http://osteele.com/archives/2006/02/javascript-beziers

I've tried iterating along the curve with BezierPoint--literally walking back and forth to see if this rounded pixel value is different from the last one--but its whole-pixel approximation is chunky and falls apart when the curves are very tight. Something elegant is needed!
Re: LazyWeb Request: Length of a Bezier
Reply #1 - May 6th, 2007, 3:21pm
 
Did some googling, but I'm afraid I'm not enough of a math viz to decode most of the reference materials out there. In the past I've done a rough approximation by simply iterating over the curve with a small-ish step size, then adding up the total distance travelled.

If I understand you correctly you're looking at pixels travelled, but I'd think that's less precise than simply looking at the accumulated vector distances.
Page Index Toggle Pages: 1