Commit 1ff64ca8 authored by Guillaume Seguin's avatar Guillaume Seguin

Support circular beds in plater

parent 8a495942
......@@ -213,10 +213,13 @@ class StlPlater(Plater):
save_wildcard = _("STL files (*.stl;*.STL)|*.stl;*.STL")
def __init__(self, filenames = [], size = (800, 580), callback = None,
parent = None, build_dimensions = None, simarrange_path = None):
parent = None, build_dimensions = None, circular_platform = False,
simarrange_path = None):
super(StlPlater, self).__init__(filenames, size, callback, parent, build_dimensions)
if glview:
viewer = stlview.StlViewPanel(self, (580, 580), build_dimensions = self.build_dimensions)
viewer = stlview.StlViewPanel(self, (580, 580),
build_dimensions = self.build_dimensions,
circular = circular_platform)
else:
viewer = showstl(self, (580, 580), (0, 0))
self.simarrange_path = simarrange_path if simarrange_path else "./simarrange/sa"
......
......@@ -786,6 +786,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
plater.StlPlater(size = (800, 580), callback = self.platecb,
parent = self,
build_dimensions = self.build_dimensions_list,
circular_platform = self.settings.circular_bed,
simarrange_path = self.settings.simarrange_path).Show()
def platecb(self, name):
......
......@@ -57,7 +57,8 @@ class stlview(object):
class StlViewPanel(wxGLPanel):
def __init__(self, parent, size, id = wx.ID_ANY, build_dimensions = None):
def __init__(self, parent, size, id = wx.ID_ANY,
build_dimensions = None, circular = False):
super(StlViewPanel, self).__init__(parent, id, wx.DefaultPosition, size, 0)
self.batches = []
self.rot = 0
......@@ -71,7 +72,8 @@ class StlViewPanel(wxGLPanel):
self.build_dimensions = build_dimensions
else:
self.build_dimensions = [200, 200, 100, 0, 0, 0]
self.platform = actors.Platform(self.build_dimensions, light = True)
self.platform = actors.Platform(self.build_dimensions, light = True,
circular = circular)
self.dist = max(self.build_dimensions[0], self.build_dimensions[1])
self.basequat = [0, 0, 0, 1]
wx.CallAfter(self.forceresize)
......
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