When morphing between two paths, it is important that both paths have the same number and type of path commands. These commands are represented by single letters in the path definition under the attribute d=""
. To learn more about these commands, refer to the SVG spec.
The first SVG file (arr.svg) contains X commands:
arr.svg add.svg
-------------- --------------
M12.222,13.293 M29.000,22.000
L7.000,13.000 L22.000,22.000
L17.172,23.899 L22.000,29.000
L17.172,23.899 L18.000,33.000
L20.000,26.728 L18.000,22.000
L20.000,26.728 L7.000,22.000
L20.000,26.728 L10.000,18.000
L22.828,23.899 L18.000,18.000
L22.828,23.899 L18.000,10.000
L33.000,13.000 L22.000,7.000
L27.778,13.293 L22.000,18.000
L20.000,21.071 L32.000,18.000
L14.343,15.414 L29.000,22.000
Z
Your two SVG files are very similar. By adding a 'Z' command to the first file, you should be able to animate them seamlessly.
<svg viewBox="0 0 121.5 60.834">
<path d="">
<animate attributeName="d" dur="2s" repeatCount="indefinite"
keyTimes="0;0.5;1"
values="M12.222,13.293 L7.000,13.000 L17.172,23.899 L17.172,23.899 L20.000,26.728 L20.000,26.728 L20.000,26.728 L22.828,23.899 L22.828,23.899 L33.000,13.000 L27.778,13.293 L20.000,21.071 L14.343,15.414 Z;
M29.000,22.000 L22.000,22.000 L22.000,29.000 L18.000,33.000 L18.000,22.000 L7.000,22.000 L10.000,18.000 L18.000,18.000 L18.000,10.000 L22.000,7.000 L22.000,18.000 L32.000,18.000 L29.000,22.000 Z;
M12.222,13.293 L7.000,13.000 L17.172,23.899 L17.172,23.899 L20.000,26.728 L20.000,26.728 L20.000,26.728 L22.828,23.899 L22.828,23.899 L33.000,13.000 L27.778,13.293 L20.000,21.071 L14.343,15.414 Z"/>
</path>
</svg>