Commit d1b98691 authored by Jayant Khatkar's avatar Jayant Khatkar

remove slicing script since cli is broken (#68)

parent 063a1519
......@@ -11,39 +11,6 @@ import gcode2contour as gc
import utils as tu
default_config = '../config/Slic3rConfig.ini'
def slice_stls(filenames, out_address, config=default_config, overwrite=False):
"""
Slice a list of STLs, construct gcode files with same name
"""
gcodes = []
for f in filenames:
# create gcode file
object_name = f.split('/')[-1].split('.')[0]
out_fname = out_address + object_name + '.gcode'
# if file already exist and not overwriting
if not overwrite and os.path.exists(out_fname):
gcodes.append(out_fname)
continue
# if file already exists, and we want to overwrite
elif overwrite and os.path.exists(out_fname):
os.remove(out_fname)
# run slicer
command = 'slic3r ' + f + \
' --load ' + config + \
' -o ' + out_fname
sp.run(command.split())
gcodes.append(out_fname)
return gcodes
def batch_run(
gcode_files,
output_notes_file,
......@@ -93,11 +60,8 @@ def batch_run(
if __name__ == '__main__':
# read stl files to slice
# read gcode files to plan for
stl_add = '../stls/'
filenames = [stl_add + 'cylinder.stl', stl_add + 'flexirex.stl']
out = './gcode/'
gcode_files = [stl_add + 'cylinder.gcode', stl_add + 'flexirex.gcode']
# slice
gcode_files = slice_stls(filenames, out)
batch_run(gcode_files, 2, 500)
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment