Commit 12f46f94 authored by Guillaume Seguin's avatar Guillaume Seguin

Enable antialiasing in plater & gcodeplater

parent 317eff86
......@@ -43,9 +43,10 @@ class GcodePlater(Plater):
load_wildcard = _("GCODE files (*.gcode;*.GCODE;*.g)") + "|*.gcode;*.gco;*.g"
save_wildcard = _("GCODE files (*.gcode;*.GCODE;*.g)") + "|*.gcode;*.gco;*.g"
def __init__(self, filenames = [], size = (800, 580), callback = None, parent = None, build_dimensions = None, circular_platform = False):
def __init__(self, filenames = [], size = (800, 580), callback = None, parent = None, build_dimensions = None, circular_platform = False, antialias_samples = 0):
super(GcodePlater, self).__init__(filenames, size, callback, parent, build_dimensions)
viewer = gcview.GcodeViewPanel(self, build_dimensions = self.build_dimensions)
viewer = gcview.GcodeViewPanel(self, build_dimensions = self.build_dimensions,
antialias_samples = antialias_samples)
self.set_viewer(viewer)
self.platform = actors.Platform(self.build_dimensions,
circular = circular_platform)
......
......@@ -214,12 +214,13 @@ class StlPlater(Plater):
def __init__(self, filenames = [], size = (800, 580), callback = None,
parent = None, build_dimensions = None, circular_platform = False,
simarrange_path = None):
simarrange_path = None, antialias_samples = 0):
super(StlPlater, self).__init__(filenames, size, callback, parent, build_dimensions)
if glview:
viewer = stlview.StlViewPanel(self, (580, 580),
build_dimensions = self.build_dimensions,
circular = circular_platform)
circular = circular_platform,
antialias_samples = antialias_samples)
else:
viewer = showstl(self, (580, 580), (0, 0))
self.simarrange_path = simarrange_path if simarrange_path else "./simarrange/sa"
......
......@@ -480,7 +480,8 @@ class PronterWindow(MainWindow, pronsole.pronsole):
parent = self,
build_dimensions = self.build_dimensions_list,
circular_platform = self.settings.circular_bed,
simarrange_path = self.settings.simarrange_path).Show()
simarrange_path = self.settings.simarrange_path,
antialias_samples = int(self.settings.antialias3dsamples)).Show()
def plate_gcode(self, e):
from . import gcodeplater as plater
......@@ -488,7 +489,8 @@ class PronterWindow(MainWindow, pronsole.pronsole):
plater.GcodePlater(size = (800, 580), callback = self.platecb,
parent = self,
build_dimensions = self.build_dimensions_list,
circular_platform = self.settings.circular_bed).Show()
circular_platform = self.settings.circular_bed,
antialias_samples = int(self.settings.antialias3dsamples)).Show()
def platecb(self, name):
self.log(_("Plated %s") % name)
......
......@@ -60,8 +60,10 @@ class StlViewPanel(wxGLPanel):
do_lights = False
def __init__(self, parent, size, id = wx.ID_ANY,
build_dimensions = None, circular = False):
super(StlViewPanel, self).__init__(parent, id, wx.DefaultPosition, size, 0)
build_dimensions = None, circular = False,
antialias_samples = 0):
super(StlViewPanel, self).__init__(parent, id, wx.DefaultPosition, size, 0,
antialias_samples = antialias_samples)
self.batches = []
self.rot = 0
self.canvas.Bind(wx.EVT_MOUSE_EVENTS, self.move)
......
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