ShapeLayer rectangle > trim path start end offset expression to adjust with rectangle size

Moderators: Disciple, zlovatt

Post Reply
manjunath7472
Posts: 7
Joined: June 1st, 2015, 8:42 am

Hi there,

please check image attached.

i have simple rectangle with stroke and trim path. When i adjust size of rectangle width or height then the start, end, offset of trim path shud adjust automatically to new rectangle size to retain original shape.

Please help.

Attachments
trimmmm.PNG
trimmmm.PNG (166.56 KiB) Viewed 1870 times
kjell
Posts: 1
Joined: December 7th, 2022, 12:19 pm

I've been trying to solve this same problem actually.

The issue is that there doesn't seem to be a way to link the start/end of the trim paths to either a specific segment or vertex of the path.

There are some extendscript functions that will be useful:

https://ae-expressions.docsforadobe.dev ... 0-5-t-time

PointOnPath(%,t) will return (x,y) values given a specific % of the path length, but I haven't been able to figure out if there's a way to do the reverse: return a % given a known coordinate on the path.

So far my best idea is to use the 'method of exhaustion', which is to feed 'pointOnPath()' increments of something like 0.1%, and then compare the resultant values to a specified vertex point, and if the difference is within a certain error threshold, then use that % of the arc-length as the value for the start/end.

Post Reply