Changing SVG coordinates back to Euclidean

Viewed 15

Please note: I'm new to this SVG world. I'm trying to convert the SVG coordinates back to Euclidean. This is very likely transformed due to viewBox parameters.

More specifically: I enter a set of xy coordinates which represents the mixture of discrete lines and partial circles:

301 956 299 956 297 957 296 957 293 958 292 958 290 958 288 959 ...

This turns out to be a set of lines and partial circles(curve decompositions) like below:

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
 "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="11325.1mm" height="11381.3mm" 
     viewBox="0 0 32102.5 32261.8" 
     xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" >
<desc>output.svg, created with the Board library (Copyleft) 2007 Sebastien Fourey</desc>
<path  fill="none" stroke="rgb(255,0,0)" stroke-width="35.278mm" style="stroke-linecap:butt;stroke-linejoin:miter" d='M 19254.4,482.12 A 16051.3 16051.3 0 0 0 12848.1,482.12' /><path  fill="none" stroke="rgb(255,0,0)" stroke-width="35.278mm" style="stroke-linecap:butt;stroke-linejoin:miter" d='M 13883.2,27417 A 13801.1 13801.1 0 0 0 29898.9,14831.2' /><path  fill="none" stroke="rgb(255,0,0)" stroke-width="35.278mm" style="stroke-linecap:butt;stroke-linejoin:miter" d='M 29658.5,14566.8 A 1974.85 1974.85 0 0 0 29941.9,12894.4' /><path  fill="none" stroke="rgb(255,0,0)" stroke-width="35.278mm" style="stroke-linecap:butt;stroke-linejoin:miter" d='M 29953.6,12905.6 A 13501.5 13501.5 0 0 0 19323.7,518.19' /><line x1="12848.1" y1="478.26" x2="12593" y2="846.76" fill="none" stroke="rgb(0,255,0)" stroke-width="17.639mm" style="stroke-linecap:butt;stroke-linejoin:miter" />
<line x1="12593" y1="846.76" x2="12281.2" y2="2831.02" fill="none" stroke="rgb(0,255,0)" stroke-width="17.639mm" style="stroke-linecap:butt;stroke-linejoin:miter" />
<line x1="12281.2" y1="2831.02" x2="11912.7" y2="3114.48" fill="none" stroke="rgb(0,255,0)" stroke-width="17.639mm" style="stroke-linecap:butt;stroke-linejoin:miter" />
<line x1="11912.7" y1="3114.48" x2="10750.5" y2="24062.5" fill="none" stroke="rgb(0,255,0)" stroke-width="17.639mm" style="stroke-linecap:butt;stroke-linejoin:miter" />
<line x1="10750.5" y1="24062.5" x2="11062.3" y2="24402.7" fill="none" stroke="rgb(0,255,0)" stroke-width="17.639mm" style="stroke-linecap:butt;stroke-linejoin:miter" />
<line x1="11062.3" y1="24402.7" x2="11090.6" y2="26585.3" fill="none" stroke="rgb(0,255,0)" stroke-width="17.639mm" style="stroke-linecap:butt;stroke-linejoin:miter" />
<line x1="11090.6" y1="26585.3" x2="11232.4" y2="26783.8" fill="none" stroke="rgb(0,255,0)" stroke-width="17.639mm" style="stroke-linecap:butt;stroke-linejoin:miter" />
<line x1="11232.4" y1="26783.8" x2="12139.5" y2="27067.2" fill="none" stroke="rgb(0,255,0)" stroke-width="17.639mm" style="stroke-linecap:butt;stroke-linejoin:miter" />
<line x1="12139.5" y1="27067.2" x2="13896.9" y2="27407.4" fill="none" stroke="rgb(0,255,0)" stroke-width="17.639mm" style="stroke-linecap:butt;stroke-linejoin:miter" />
<line x1="29912.7" y1="14821.6" x2="29685.9" y2="14566.5" fill="none" stroke="rgb(0,255,0)" stroke-width="17.639mm" style="stroke-linecap:butt;stroke-linejoin:miter" />
</svg>

But the coordinate system here shows a totally different scale. I'd like to be able to convert them back to "normal" coordinates which corresponds to scale of my original input. I think it has something to do with viewBox. Y coordinates in this system being upside down is already another problem for me. Any ideas? Sorry, if my question sounds too easy and stupid..

0 Answers
Related