Skip to main content
c.pfaffenbichler
Community Expert
Community Expert
April 21, 2010
Question

determining bezier curves segments’ lengths with javascript

  • April 21, 2010
  • 1 reply
  • 783 views

Do any of you have an idea if/how one can determine the length of a curved line between two points with bezier-handles?

And if that can be utilized in JavaScript?

My math-skills are far from great, so determining positions for points on a curved path (and that without determining leftDirection and rightDirection-values for those) was already an achievement for me, but the lengths of the segments are even more mysterious.

Thanks for any advice.

This topic has been closed for replies.

1 reply

Muppet_Mark-QAl63s
Inspiring
April 21, 2010

I took a look into this for something I wanted to do in Illustrator… I wasn't even able to calculate how far short my math was…   but it was a lot…

c.pfaffenbichler
Community Expert
Community Expert
April 21, 2010

I did some searching in the meantime, check out

http://park12.wakwak.com/~shp/lc/et/en_aics_script.html#join_reasonably

The Path Length Script works pretty well for Photoshop, too.

Edit: To specify: I used the function getLength for Photoshop Paths.

I suspect points with only one handle (different from the point itself) can throw the calculation for Photoshop Paths’ lengths and I’m not sure about open Paths.

But in some tests it worked seemingly fine.