def main(args): from modules.utils import get_tris_from_file as get fn = args.fn paths = get(fn, spatial_concat=True, spatial_concat_eps=1.e-13) with Device(scale=0.99, penup=0.4) as device: device.do_paths(paths)
def main(args): from modules.utils import get_paths_from_file as get fn = args.fn paths = row_stack(get(fn, spatial_sort=False, spatial_concat=False)) with Device(scale=0.99, drawing_speed=10, penup=1) as device: device.do_paths([paths])
def main(): from numpy import row_stack path = row_stack([[0.1, 0.1], [0.8, 0.1], [0.8, 0.8], [0.1, 0.8], [0.1,0.1]]) paths = [path] with Device(verbose=True) as device: device.do_paths(paths)
def main(args): from modules.utils import get_edges_from_file as get fn = args.fn paths = get(fn) # ss = row_stack(paths) # print(min(ss[:,0], axis=0), max(ss[:,0], axis=0)) # print(min(ss[:,1], axis=0), max(ss[:,1], axis=0)) with Device(scale=0.99, penup=0.4) as device: device.do_paths(paths)
def main(args): from modules.utils import get_paths_from_n_files as get pattern = args.pattern steps = args.steps stride = args.stride skip = args.skip paths = get(pattern, skip, steps, stride, spatial_concat=True, spatial_concat_eps=1e-4) with Device(scale=0.99, penup=0.4) as device: device.do_paths(paths)
def main(): with Device(verbose=True) as device: i = 1 while True: if i % 2 == 0: print('down') device.pendown() else: print('up') device.penup() input('flip ...') i += 1
def main(args): from modules.utils import get_dots_from_file as get fn = args.fn rad = args.rad verts = get(fn) if rad is not None: if rad > 1.0 or rad < 0.001: print('ERROR: rad must be None or between 1.0 and 0.001.') exit(1) with Device(scale=0.99, penup=0.4) as device: if rad is not None: paths = dots_to_circs(verts, rad) device.do_paths(paths) else: device.do_dots(verts)
def main(): paths = [array([[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]], 'float')] with Device(scale=0.99, penup=0.4) as device: device.do_paths(paths)