-
Notifications
You must be signed in to change notification settings - Fork 17
/
svg.py
18 lines (15 loc) · 3.36 KB
/
svg.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import xy
PATHS = [
"M99.167,143.833 L94.702,143.62 L90.366,142.993 L86.182,141.975 L82.17,140.585 L78.353,138.844 L74.752,136.774 L71.391,134.395 L68.29,131.727 L65.471,128.792 L62.958,125.61 L60.77,122.202 L58.932,118.589 L57.463,114.791 L56.387,110.83 L55.725,106.726 L55.5,102.5 L55.725,98.274 L56.387,94.17 L57.463,90.209 L58.932,86.411 L60.77,82.798 L62.958,79.39 L65.471,76.208 L68.29,73.273 L71.391,70.605 L74.752,68.226 L78.353,66.156 L82.17,64.415 L86.182,63.025 L90.366,62.007 L94.702,61.38 L99.167,61.167 L103.632,61.38 L107.967,62.007 L112.152,63.025 L116.164,64.415 L119.981,66.156 L123.581,68.226 L126.943,70.605 L130.044,73.273 L132.862,76.208 L135.376,79.39 L137.563,82.798 L139.402,86.411 L140.87,90.209 L141.946,94.17 L142.608,98.274 L142.833,102.5 L142.608,106.726 L141.946,110.83 L140.87,114.791 L139.402,118.589 L137.563,122.202 L135.376,125.61 L132.862,128.792 L130.044,131.727 L126.943,134.395 L123.581,136.774 L119.981,138.844 L116.164,140.585 L112.152,141.975 L107.967,142.993 L103.632,143.62 L99.167,143.833 L99.167,143.833",
"M59.973,120.977 L61.518,123.64 L63.225,126.147 L65.085,128.499 L67.089,130.691 L69.228,132.724 L71.493,134.596 L73.875,136.304 L76.367,137.847 L78.957,139.223 L81.639,140.432 L84.403,141.47 L87.239,142.336 L90.14,143.029 L93.096,143.548 L96.099,143.889 L99.139,144.052 L101.873,143.935 L104.617,143.66 L107.357,143.229 L110.081,142.642 L112.775,141.901 L115.425,141.006 L118.02,139.959 L120.545,138.76 L122.987,137.411 L125.333,135.913 L127.57,134.267 L129.685,132.473 L131.664,130.534 L133.494,128.449 L135.163,126.221 L136.656,123.85 L141.642,127.409 L146.385,131.238 L150.896,135.316 L155.185,139.621 L159.262,144.133 L163.138,148.83 L166.823,153.69 L170.328,158.693 L172.846,162.726 L175.19,166.798 L177.361,170.901 L179.359,175.028 L181.184,179.172 L182.837,183.325 L184.317,187.481 L185.626,191.633 L186.764,195.774 L187.729,199.896 L188.524,203.992 L189.148,208.056 L189.602,212.08 L189.885,216.057 L189.998,219.98 L189.941,223.842 L189.714,227.636 L189.319,231.354 L188.754,234.99 L188.021,238.537 L187.119,241.987 L186.049,245.334 L184.811,248.57 L183.405,251.688 L181.832,254.681 L180.092,257.543 L178.185,260.265 L176.111,262.841 L173.87,265.264 L171.464,267.526 L168.892,269.621 L166.154,271.542 L163.285,273.261 L160.325,274.758 L157.279,276.034 L154.154,277.094 L150.957,277.94 L147.694,278.574 L144.372,278.999 L140.998,279.217 L137.577,279.232 L134.118,279.045 L130.625,278.66 L127.107,278.079 L123.569,277.305 L120.017,276.341 L116.46,275.189 L112.903,273.851 L109.352,272.331 L105.815,270.63 L102.297,268.753 L98.807,266.701 L95.349,264.477 L91.931,262.083 L88.559,259.523 L85.24,256.799 L81.98,253.913 L78.787,250.869 L75.666,247.668 L72.624,244.314 L69.668,240.809 L66.804,237.156 L64.039,233.357 L61.38,229.416 L57.221,222.557 L53.484,215.46 L50.198,208.144 L47.391,200.628 L45.867,195.716 L44.544,190.63 L43.447,185.407 L42.597,180.082 L42.017,174.688 L41.73,169.263 L41.759,163.84 L42.127,158.456 L42.855,153.145 L43.967,147.943 L45.486,142.884 L47.434,138.004 L49.834,133.338 L52.709,128.922 L56.081,124.789 L57.961,122.841 L59.973,120.977 L59.973,120.977",
]
def main():
paths = []
for path in PATHS:
paths.extend(xy.parse_svg_path(path))
drawing = xy.Drawing(paths).scale(1, -1).scale_to_fit(9 * 25.4, 12 * 25.4)
im = drawing.render()
im.write_to_png('svg.png')
xy.draw(drawing)
if __name__ == '__main__':
main()