-
shape path expression: connect 2 curves
Hi!
I was playing with the idea of having a flying piece of paper, via shape layer and some path expressions.
I’ve this thing done:
which is, 2 paths with trim paths on each one, and then I created 2 shape paths via expressions, to have a line go from the start trim on curve A to the start trim on curve B, and same with the endings
Then with a slider called “grow”, making it all flowon these shapes, Im using this expression (same on the ending parts changing “start” with “end”)
var pathDelante =content("delante").content("Path 1").path
var pathDetras=content("detras").content("Path 1").pathadelante=content("delante").content("Trim Paths 1").start/100;
a=(pathDelante.pointOnPath(adelante));
//bdetras=content("detras").content("Trim Paths 1").start/100;
b=(pathDetras.pointOnPath(bdetras));
//TL=[a[0],a[1]]
TR=[b[0],b[1]]
//
createPath(points = [TL, TR], inTangents = [], outTangents = [], is_closed = false);
The problem is the gap we see when the curves have their peak, we should have a tangent line connecting the vertex of both curves at that point.

I will need a new path shape, to create a line to connect these 2 vertex when needed (maybe via checkbox, or even better, making it follow the start or ending trim, but adding some sort of clamp so that line stuck there until the top line or bottom line reaches that point)
Also, as the curves may vary, I cannot give to the expression a given number of vertex to do that, so it should be calculated on the fly…
But I have no idea about how to achieve that (or if thats even possible)
do you have any idea?
thanks!
(adding a fill color to that will be a different story)