drawing svg in python with paths not shapes or convert them
<p>I'm making a microscope filter generator, first it draws svg image then they are converted in 3D for 3d printing.</p>

<p>I used 'svgwrite'</p>

<p>However this librayry generates svg with shapes (line, circle, etc), at the time I didn't know but every 3D conversion librayry/softwares needs the svg to contain path.</p>

<p>Is there a librayry that generates svg files with path (but allow me in the script to draw easily circles, lines, etc?) </p>

<p>Or is there a way to convert those svg shape to svg path?</p>

<p>example of my current svg  with shape :</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
&lt;svg baseProfile="tiny" height="100%" version="1.2" width="100%" xmlns="http://www.w3.org/2000/svg" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xlink="http://www.w3.org/1999/xlink"&gt;
&lt;defs /&gt;
&lt;circle cx="270" cy="270" fill="white" r="135.0" stroke="black" stroke-width="10" /&gt;
&lt;circle cx="270" cy="270" r="25.0" /&gt;
&lt;line stroke="black" stroke-width="10" x1="270" x2="270" y1="270" y2="135.0" /&gt;
&lt;line stroke="black" stroke-width="10" x1="270" x2="405.0" y1="270" y2="347.9423" /&gt;
&lt;line stroke="black" stroke-width="10" x1="270" x2="135.0" y1="270" y2="347.9423" /&gt;
&lt;/svg&gt;
</code></pre>

<p>Thanks.</p>

<p>PS : note that I have to do this programaticaly because I intend to generate a lot of filters.</p>

<p>Line and Circle have a straightforward translation to a Path entity, using MoveTo/LineTo/EllipticalArc.</p>

<p>It shouldn't be a great deal to just replace those lines in the Xml source and keep all the rest, with a home-made script.</p>

python svg