Replace the line grid with a checkerboard pattern, this looks better and less like RepG
This commit is contained in:
parent
1d253f62f0
commit
10a828d004
3 changed files with 34 additions and 12 deletions
|
|
@ -56,16 +56,38 @@ def DrawMachine(machineSize):
|
|||
glVertex3f(machineSize.x, machineSize.y, 0)
|
||||
glVertex3f(0, machineSize.y, 0)
|
||||
glEnd()
|
||||
glColor3f(0.7,0.7,0.7)
|
||||
glLineWidth(2)
|
||||
glBegin(GL_LINES)
|
||||
for i in xrange(0, int(machineSize.x), 10):
|
||||
glVertex3f(i, 0, 0)
|
||||
glVertex3f(i, machineSize.y, 0)
|
||||
for i in xrange(0, int(machineSize.y), 10):
|
||||
glVertex3f(0, i, 0)
|
||||
glVertex3f(machineSize.x, i, 0)
|
||||
glEnd()
|
||||
if False:
|
||||
glColor3f(0.7,0.7,0.7)
|
||||
glLineWidth(2)
|
||||
glBegin(GL_LINES)
|
||||
for i in xrange(0, int(machineSize.x), 10):
|
||||
glVertex3f(i, 0, 0)
|
||||
glVertex3f(i, machineSize.y, 0)
|
||||
for i in xrange(0, int(machineSize.y), 10):
|
||||
glVertex3f(0, i, 0)
|
||||
glVertex3f(machineSize.x, i, 0)
|
||||
glEnd()
|
||||
else:
|
||||
glColor4f(0.7,0.7,0.7,0.7)
|
||||
glDisable(GL_CULL_FACE)
|
||||
glEnable(GL_BLEND)
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
|
||||
glBegin(GL_QUADS)
|
||||
for x in xrange(0, int(machineSize.x), 20):
|
||||
for y in xrange(0, int(machineSize.y), 20):
|
||||
glVertex3f(x, y, -0.01)
|
||||
glVertex3f(min(x+10, machineSize.x), y, -0.01)
|
||||
glVertex3f(min(x+10, machineSize.x), min(y+10, machineSize.y), -0.01)
|
||||
glVertex3f(x, min(y+10, machineSize.y), -0.01)
|
||||
for x in xrange(10, int(machineSize.x), 20):
|
||||
for y in xrange(10, int(machineSize.y), 20):
|
||||
glVertex3f(x, y, -0.01)
|
||||
glVertex3f(min(x+10, machineSize.x), y, -0.01)
|
||||
glVertex3f(min(x+10, machineSize.x), min(y+10, machineSize.y), -0.01)
|
||||
glVertex3f(x, min(y+10, machineSize.y), -0.01)
|
||||
glEnd()
|
||||
glEnable(GL_CULL_FACE)
|
||||
glDisable(GL_BLEND)
|
||||
glLineWidth(1)
|
||||
glBegin(GL_LINE_LOOP)
|
||||
glVertex3f(0, 0, machineSize.z)
|
||||
|
|
|
|||
|
|
@ -486,7 +486,6 @@ class PreviewGLCanvas(glcanvas.GLCanvas):
|
|||
|
||||
def OnDraw(self):
|
||||
machineSize = self.parent.machineSize
|
||||
opengl.DrawMachine(machineSize)
|
||||
|
||||
if self.parent.gcode != None and self.parent.gcodeDirty:
|
||||
if self.gcodeDisplayListCount < len(self.parent.gcode.layerList) or self.gcodeDisplayList == None:
|
||||
|
|
@ -633,6 +632,7 @@ class PreviewGLCanvas(glcanvas.GLCanvas):
|
|||
glEnd()
|
||||
glEnable(GL_DEPTH_TEST)
|
||||
glFlush()
|
||||
opengl.DrawMachine(machineSize)
|
||||
|
||||
def drawModel(self, obj):
|
||||
multiX = 1 #int(profile.getProfileSetting('model_multiply_x'))
|
||||
|
|
|
|||
|
|
@ -779,7 +779,6 @@ class PreviewGLCanvas(glcanvas.GLCanvas):
|
|||
|
||||
def OnDraw(self):
|
||||
machineSize = self.parent.machineSize
|
||||
opengl.DrawMachine(util3d.Vector3(machineSize[0], machineSize[1], machineSize[2]))
|
||||
extraSizeMin, extraSizeMax = self.parent.getExtraHeadSize()
|
||||
|
||||
for item in self.parent.list:
|
||||
|
|
@ -868,6 +867,7 @@ class PreviewGLCanvas(glcanvas.GLCanvas):
|
|||
|
||||
glPopMatrix()
|
||||
|
||||
opengl.DrawMachine(util3d.Vector3(machineSize[0], machineSize[1], machineSize[2]))
|
||||
glFlush()
|
||||
|
||||
class ProjectSliceProgressWindow(wx.Frame):
|
||||
|
|
|
|||
Loading…
Reference in a new issue