4 Replies Latest reply on Sep 23, 2012 11:08 AM by Muppet Mark

# Finding a Point on a Path

Is there any way to find a specific point on a path, that is not necessarily an anchor point?

What I'd like to be able to do is tell Illustrator "Give me the coordinates of the point that's exactly at half of this path's length" or "... exactly 25% ...". And if that's possible, can I somehow add an anchor point to that point, or cut the path at that point?

Thanks!

• ###### 1. Re: Finding a Point on a Path

For straight lines only, or optionally for curved lines as well? For a given straight path segment, or any object?

Straight lines is straightforward interpolation:

for every pair of points (A,B) test if your target is between Ax and Bx, and Ay and By. If so, your coordinates are Ax+d*(Bx-Ax) and Ay+d*(By-Ay) (where d is your factor in decimals, 25% is 0.25).

Curved lines are represented by Bézier curves, and there is no straightforward solution. In that case you have to subdivide the curve until you are "close enough". Still fairly easy, but I cannot type *that* from memory. :-)

Note that there is a difference in the order of points: 25% up the path from A to B is different then from B to A.

• ###### 2. Re: Finding a Point on a Path

With Scriptographer it is really easy:

http://scriptographer.org/reference/ai/path/#