Пример #1
0
    def setUp(self):
        self.s = get_test_settings()
        tm = import_file(TEST_FILE_CUBE, self.s)

        lm = slice_model(tm, self.s)

        self.gcode = get_gcode_filename()
        encode(lm, self.s, self.gcode)

        print 'G-code file:', self.gcode
Пример #2
0
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
Пример #3
0
def encode_models(lms, settings):
    gs = []
    for lm in lms:
        settings.gcode = get_gcode_filename()
        gs.append(gcoder.encode(lm, settings))
    return gs