Search code examples
svgpathconverterspolylineellipse

Convert new svg elements to path


I'm working with a new illustrator svg file I guess, and I want to animate the path inside it, but I've incurred in few issues which means that I don't know how to interact with ellipse, polyline and circle. I'd like to know how to transform at least how to convert an ellipse element into a path element. Here's my file:

<svg version="1.1" id="Layer_1" class="snap" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
                    viewBox="0 0 106.2 107" style="enable-background:new 0 0 106.2 107;" xml:space="preserve">
                    <style type="text/css">
                        .st0{fill:none;stroke:#8DC63F;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;}
                    </style>
                    <g>

                        <ellipse transform="matrix(0.7071 -0.7071 0.7071 0.7071 -22.2783 53.2037)" class="st0" cx="53.1" cy="53.5" rx="38.1" ry="38.1"/>
                        <polyline class="st0" points="32,48.8 32,35.8 41.6,48.8 41.6,35.8   "/>
                        <polyline class="st0" points="65.2,48.8 65.2,35.8 74.9,48.8 74.9,35.8   "/>
                        <polyline class="st0" points="58.2,69.7 58.2,56.7 52.8,64 47.5,56.7 47.5,69.7   "/>
                        <circle class="st0" cx="53.6" cy="42.3" r="6.5"/>
                        <circle class="st0" cx="70.7" cy="63.2" r="6.5"/>
                        <path class="st0" d="M41.1,58.2c-1.1-0.9-2.6-1.5-4.1-1.5c-3.6,0-6.5,2.9-6.5,6.5c0,3.6,2.9,6.5,6.5,6.5c1.6,0,3.1-0.6,4.3-1.6
                        v-4.6H37"/>
                    </g>
                </svg>

Does it exist any converter online which can do this job for me?


Solution

  • If I understand ok, you want to animate the svg path? by that do you mean to animate the stroke of it? if yes, I made a plugin just for that, it supports rect, circle, line and polygon : zPath.js

    Or if you only want a solution to convert any element into a path yes there is Flatten.js as far as I know, I did not use it I found it on this post