0

When i create a circle in inkscape using the circle tool and then click on object to path i get the below svg:

<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   width="210mm"
   height="297mm"
   viewBox="0 0 210 297"
   version="1.1"
   id="svg8"
   inkscape:version="0.92.2 5c3e80d, 2017-08-06"
   sodipodi:docname="cirlce-path.svg">
  <metadata
     id="metadata5">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
        <dc:title></dc:title>
      </cc:Work>
    </rdf:RDF>
  </metadata>
  <g
     inkscape:label="Layer 1"
     inkscape:groupmode="layer"
     id="layer1">
    <path
       style="opacity:1;fill:none;fill-opacity:1;stroke:#ff0000;stroke-width:1.7128253;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
       d="M 140.154,165.16815 A 49.143589,49.143589 0 0 1 91.010414,214.31174 49.143589,49.143589 0 0 1 41.866825,165.16815 49.143589,49.143589 0 0 1 91.010414,116.02456 49.143589,49.143589 0 0 1 140.154,165.16815 Z"
       id="path956" />
  </g>
</svg>

As you can see the path command is:-

M 140.154,165.16815 A 49.143589,49.143589 0 0 1 91.010414,214.31174 49.143589,49.143589 0 0 1 41.866825,165.16815 49.143589,49.143589 0 0 1 91.010414,116.02456 49.143589,49.143589 0 0 1 140.154,165.16815 Z

But what i really want is a path with a command structure of MCCCCZ like below:-

<svg
   width="345.70975"
   height="352.91309"
   viewBox="0 0 340 340"
   id="svg8">
  <g
     id="layer1">
    <path
       style="opacity:1;fill:none;fill-opacity:1;stroke:#800080;stroke-width:1.29393971;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
       d="M 89.289322,89.289322 c 42.392448,-38.369033 104.952908,-35.372751 141.421358,0 39.05243,39.052428 39.05243,102.368928 0,141.421358 -39.05243,39.05243 -102.36893,39.05243 -141.421358,0 -39.05243,-39.05243 -39.052429,-102.36893 0,-141.421358 z"
       id="rect818"
       class="square-path" />
  </g>
</svg>

Because i can only use the path with a MCCCCZ command structure for a svg animation.

1 Answer 1

1

What you want is to convert the arc commands A into (approximate) Bézier curvers C.

A way I found to do this is to use the node tool, select all nodes, and click for example on the make selected nodes smooth icon. This turns arcs into curves.

4
  • still get m 146.65868,142.48958 c 0,26.97617 -21.86851,48.84468 -48.844685,48.84468 -26.976173,0 -48.844682,-21.86851 -48.84468,-48.84468 -1e-6,-26.97617 21.868507,-48.844678 48.84468,-48.844679 26.976175,-2e-6 48.844685,21.868509 48.844685,48.844679 z I.E. MCZ not MCCCCZ Dec 22, 2021 at 5:52
  • 1
    If you then "Break path at selected nodes", then you get a single MCMCMCMC path, but now the segments are no longer joined.
    – Juancho
    Dec 22, 2021 at 17:31
  • 2
    @AlexanderSolonik 'MCZ' is completely equivalent to 'MCCCCZ' because in SVG you can omit a command symbol if the next is the same as the current one. If you really need it explicitly repeated, then manually add a lowercase 'c' between every 3 coordinate pairs after the first 'c'.
    – Xrott
    Dec 22, 2021 at 18:49
  • @Xrott thanks that helps :) Dec 23, 2021 at 6:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.