def slicing(input_file, output_file, input_settings_file, input_settings_dict, output_settings_file, scan_line, progress): progress.set_size(5) settings = SlicerSettings(file_name=input_settings_file, flat_settings_dict=input_settings_dict) progress.inc() if output_settings_file is not None: settings.write_file(output_settings_file) progress.inc() result = import_file(input_file, settings) progress.inc() if scan_line: result = slice_model(result, settings, slicer_class=ScanlineSlicer) else: result = slice_model(result, settings) progress.inc() result = encode(result, settings, output_file, scan_line) progress.done() return result
def get_test_settings(): return SlicerSettings(flat_settings_dict=TEST_SETTINGS)
def import_files(): tms = [] for file_path in TEST_FILES.keys(): tms.append(import_file(file_path)) return tms def slice_models(tms, settings): lms = [] for tm in tms: lms.append(slice_model(tm, settings)) return lms def encode_models(lms, settings): gs = [] for lm in lms: settings.gcode = get_gcode_filename() gs.append(gcoder.encode(lm, settings)) return gs if __name__ == '__main__': settings = SlicerSettings(TEST_SETTINGS) settings.verbose = False tms = profile(import_files) lms = profile(slice_models, tms=tms, settings=settings) gs = profile(encode_models, lms=lms, settings=settings)