Getting path length in mm SvgPathTools

Viewed 79

I have an svg and I need to get the length of the paths in millimeters to be used in a real life application. Using the python svgpathtools library, using the length function works well but I cannot find anywhere in the docs for svpathtools what unit is used in calculating the length of the arc (or the curves included in it)

Below is the code I currently have

paths, attributes, svg_attributes = svg2paths2('sample.svg')
for path in paths:
    for curve in path:
        print(curve.length)

This is the output I receive from running the above code

10.895300154213514
15.142629055866722
23.730517433325748
23.73105785794831
21.77125455329005
11.279624921558746
11.279680843104023
21.771279269128605
23.731580549550927
23.731627915439564
21.77125455329005
11.279624921558746
11.279680843104023
21.774144213511132
23.729677579725156
23.731627915439564
21.795916354994993
10.986505331490429
10.604205974729867
46.43923310506517
45.3986468453268
10.324124024685046
8.071888088998016
0.003605551275512736
26.124050994562996
45.737106670828
53.94962464402549
17.012395710264993
51.95279012002064
16.17007686336362
20.841277156788127
78.72783591297403
17.23728179298918
55.8107820599928
48.672712650608986
0.0010000000000331966
27.058952638511517
68.02833313606227
18.822022537493844
45.413567277673636
45.42345206832466
19.62489493121194
44.61710566995185
22.870883374333967
29.565863874964815
34.33246812172493
45.73710667082802
37.11313707897945
2.842170943040401e-14
0 Answers
Related