ribbon simple

This commit is contained in:
Michael Fogleman 2018-03-12 22:26:20 -04:00
parent b0dc60fec0
commit 876f4b98c9
1 changed files with 24 additions and 0 deletions

24
examples/ribbon-simple.py Normal file
View File

@ -0,0 +1,24 @@
from __future__ import division, print_function
import axi
import math
import random
import sys
BOUNDS = axi.A3_BOUNDS
def main():
d = axi.Drawing.load(sys.argv[1]).scale(1, -1)
print(len(d.paths))
d = d.join_paths(0.01)
d = d.rotate_and_scale_to_fit(*BOUNDS[-2:])
d = d.sort_paths()
d = d.join_paths(0.01)
d = d.simplify_paths(0.001)
print(len(d.paths))
print(d.bounds)
d.dump('out.axi')
d.render(bounds=BOUNDS).write_to_png('out.png')
if __name__ == '__main__':
main()