Commit b5ea4acb authored by Guillaume Seguin's avatar Guillaume Seguin

Make simarrange path parametric

parent 5fc81cad
...@@ -212,12 +212,14 @@ class StlPlater(Plater): ...@@ -212,12 +212,14 @@ class StlPlater(Plater):
load_wildcard = _("STL files (*.stl;*.STL)|*.stl;*.STL|OpenSCAD files (*.scad)|*.scad") load_wildcard = _("STL files (*.stl;*.STL)|*.stl;*.STL|OpenSCAD files (*.scad)|*.scad")
save_wildcard = _("STL files (*.stl;*.STL)|*.stl;*.STL") save_wildcard = _("STL files (*.stl;*.STL)|*.stl;*.STL")
def __init__(self, filenames = [], size = (800, 580), callback = None, parent = None, build_dimensions = None): def __init__(self, filenames = [], size = (800, 580), callback = None,
parent = None, build_dimensions = None, simarrange_path = None):
super(StlPlater, self).__init__(filenames, size, callback, parent, build_dimensions) super(StlPlater, self).__init__(filenames, size, callback, parent, build_dimensions)
if glview: if glview:
viewer = stlview.StlViewPanel(self, (580, 580), build_dimensions = self.build_dimensions) viewer = stlview.StlViewPanel(self, (580, 580), build_dimensions = self.build_dimensions)
else: else:
viewer = showstl(self, (580, 580), (0, 0)) viewer = showstl(self, (580, 580), (0, 0))
self.simarrange_path = simarrange_path if simarrange_path is not None else "./simarrange/sa"
self.set_viewer(viewer) self.set_viewer(viewer)
def done(self, event, cb): def done(self, event, cb):
...@@ -357,7 +359,7 @@ class StlPlater(Plater): ...@@ -357,7 +359,7 @@ class StlPlater(Plater):
print _("Autoplating using simarrange") print _("Autoplating using simarrange")
models = dict(self.models) models = dict(self.models)
files = [model.filename for model in models.values()] files = [model.filename for model in models.values()]
p = subprocess.Popen(["./simarrange/sa", "--dryrun", p = subprocess.Popen([self.simarrange_path, "--dryrun",
"-x", str(self.build_dimensions[0]), "-x", str(self.build_dimensions[0]),
"-y", str(self.build_dimensions[1])] + files, "-y", str(self.build_dimensions[1])] + files,
stdout = subprocess.PIPE) stdout = subprocess.PIPE)
......
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