Commit 81127b31 authored by Guillaume Seguin's avatar Guillaume Seguin

Draw simpler grid in stlview

parent ee91741b
...@@ -71,7 +71,8 @@ class Platform(object): ...@@ -71,7 +71,8 @@ class Platform(object):
""" """
graduations_major = 10 graduations_major = 10
def __init__(self, build_dimensions): def __init__(self, build_dimensions, light = False):
self.light = light
self.width = build_dimensions[0] self.width = build_dimensions[0]
self.depth = build_dimensions[1] self.depth = build_dimensions[1]
self.height = build_dimensions[2] self.height = build_dimensions[2]
...@@ -102,19 +103,21 @@ class Platform(object): ...@@ -102,19 +103,21 @@ class Platform(object):
elif i % (self.graduations_major / 2) == 0: elif i % (self.graduations_major / 2) == 0:
glColor4f(*self.color_grads_interm) glColor4f(*self.color_grads_interm)
else: else:
if self.light: return False
glColor4f(*self.color_grads_minor) glColor4f(*self.color_grads_minor)
return True
# draw the grid # draw the grid
glBegin(GL_LINES) glBegin(GL_LINES)
for i in range(0, int(math.ceil(self.width + 1))): for i in range(0, int(math.ceil(self.width + 1))):
color(i) if color(i):
glVertex3f(float(i), 0.0, 0.0) glVertex3f(float(i), 0.0, 0.0)
glVertex3f(float(i), self.depth, 0.0) glVertex3f(float(i), self.depth, 0.0)
for i in range(0, int(math.ceil(self.depth + 1))): for i in range(0, int(math.ceil(self.depth + 1))):
color(i) if color(i):
glVertex3f(0, float(i), 0.0) glVertex3f(0, float(i), 0.0)
glVertex3f(self.width, float(i), 0.0) glVertex3f(self.width, float(i), 0.0)
glEnd() glEnd()
# draw fill # draw fill
......
...@@ -75,7 +75,7 @@ class StlViewPanel(wxGLPanel): ...@@ -75,7 +75,7 @@ class StlViewPanel(wxGLPanel):
self.build_dimensions = build_dimensions self.build_dimensions = build_dimensions
else: else:
self.build_dimensions = [200, 200, 100, 0, 0, 0] self.build_dimensions = [200, 200, 100, 0, 0, 0]
self.platform = actors.Platform(self.build_dimensions) self.platform = actors.Platform(self.build_dimensions, light = True)
self.dist = max(self.build_dimensions[0], self.build_dimensions[1]) self.dist = max(self.build_dimensions[0], self.build_dimensions[1])
self.basequat = [0, 0, 0, 1] self.basequat = [0, 0, 0, 1]
wx.CallAfter(self.forceresize) 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