Yeah, unfortunately the library can only morph between variations of the same path. So the sequence of commands must be identical, though command parameters can be whatever you want.
Morning between entirely different paths is possible but extremely difficult, and I remember seeing a couple of large libraries out there that can figure out the math for doing so.
Ah yeah - I came here to see if you'd solved this problem, too, haha. I had this one a few years back where I was wanting to <animate> an SVG with a different number of points in its path for a nice wobble effect with no joy - I ended up doing what you did here and moving existing points around.
that looks really cool, custom and professional! Is the wobble on the curvy frame for the ladies portrait? I'm on my phone so maybe it isn't as prominent. Again, looks amazing!
Yeah, exactly - there's a background-image that's using clip-path() with an animated SVG to give it a subtle portal-like appearance. Didn't need to be much - just had to be a little bit unsettling given the subject matter.
I cohost a podcast interviewing people in the horror biz, and came to this sub thinking of asking for help testing an unrelated website I've created, happened to click here and end up checking out your link without having any idea what I was about to find lol
haha, cheeeers - honestly, it's 90% about working with a talented designer and treating the design with respect. This one was with the ineffable Flo Pollet and was a whiiile back now...
Maybe Iām thinking too simply here, but couldnāt you normalize the length of both paths before picking the anchor points and then do some kind of weighted interpolation between them? Basically interpolate between two anchor points if the number of anchors are different, and then interpolate between the interpolated anchors.
I think the issue is how you would come up with the normalised/shared form for both shapes. I havenāt tried, but I cannot imagine determining a shared formulation for 5 sequential Bezier curves and 3 straight lines to be simple.
Chop them into pieces so that each one has 15 segments. Everything in SVG paths can be turned to cubic beziers with error too small to see (none for lines or quadratic beziers, negligible for arc if you cut it into at least 4 pieces per complete circle).
The hard part is coming up with a rule for where to cut that produces sensible results. Some special cases are more obviously solvable than others (eg, if most segments of one path appear in the other to within error, avoid cutting those).
97
u/Iklowto Jun 25 '22
Yeah, unfortunately the library can only morph between variations of the same path. So the sequence of commands must be identical, though command parameters can be whatever you want.
Morning between entirely different paths is possible but extremely difficult, and I remember seeing a couple of large libraries out there that can figure out the math for doing so.