def run_test(svg_string): gcode_compiler = Compiler(CustomInterface, 1000, 300, 0, dwell_time=400) curves = parse_string(svg_string) gcode_compiler.append_curves(curves) return gcode_compiler.compile()
def run_test(svg_string): gcode_compiler = Compiler(interfaces.Gcode, 1000, 300, 2) curves = parse_string(svg_string, transform=True) gcode_compiler.append_curves(curves) return gcode_compiler.compile(passes=5)
def run_test(svg_file_name, _): root = ElementTree().parse(svg_file_name) root_curves = parse_root(root) with open(svg_file_name, 'rb') as svg_file: svg_string = svg_file.read() string_curves = parse_string(svg_string) file_curves = parse_file(svg_file_name) if str(root_curves) != str(string_curves) or str(string_curves) != str(file_curves): print("Inconsistent parsing.") print("parse_root() ->", root_curves) print("parse_string() ->", string_curves) print("parse_file() ->", file_curves) return False return True