Enable support for raft in the project planner. #181.
This commit is contained in:
parent
c0ff43a221
commit
4ae43d54fd
1 changed files with 23 additions and 28 deletions
|
@ -511,19 +511,7 @@ class projectPlanner(wx.Frame):
|
||||||
self.preview.Refresh()
|
self.preview.Refresh()
|
||||||
|
|
||||||
def _doAutoPlace(self, allowedSizeY):
|
def _doAutoPlace(self, allowedSizeY):
|
||||||
extraSizeMin = self.headSizeMin
|
extraSizeMin, extraSizeMax = self.getExtraHeadSize()
|
||||||
extraSizeMax = self.headSizeMax
|
|
||||||
if profile.getProfileSettingFloat('skirt_line_count') > 0:
|
|
||||||
skirtSize = profile.getProfileSettingFloat('skirt_line_count') * profile.calculateEdgeWidth() + profile.getProfileSettingFloat('skirt_gap')
|
|
||||||
extraSizeMin = extraSizeMin + numpy.array([skirtSize, skirtSize, 0])
|
|
||||||
extraSizeMax = extraSizeMax + numpy.array([skirtSize, skirtSize, 0])
|
|
||||||
if profile.getProfileSetting('support') != 'None':
|
|
||||||
extraSizeMin = extraSizeMin + numpy.array([3.0, 0, 0])
|
|
||||||
extraSizeMax = extraSizeMax + numpy.array([3.0, 0, 0])
|
|
||||||
|
|
||||||
if self.printMode == 1:
|
|
||||||
extraSizeMin = numpy.array([6.0, 6.0, 0])
|
|
||||||
extraSizeMax = numpy.array([6.0, 6.0, 0])
|
|
||||||
|
|
||||||
if extraSizeMin[0] > extraSizeMax[0]:
|
if extraSizeMin[0] > extraSizeMax[0]:
|
||||||
posX = self.machineSize[0]
|
posX = self.machineSize[0]
|
||||||
|
@ -582,8 +570,6 @@ class projectPlanner(wx.Frame):
|
||||||
put('add_start_end_gcode', 'False')
|
put('add_start_end_gcode', 'False')
|
||||||
put('gcode_extension', 'project_tmp')
|
put('gcode_extension', 'project_tmp')
|
||||||
if self.printMode == 0:
|
if self.printMode == 0:
|
||||||
put('enable_raft', 'False')
|
|
||||||
|
|
||||||
clearZ = 0
|
clearZ = 0
|
||||||
actionList = []
|
actionList = []
|
||||||
for item in self.list:
|
for item in self.list:
|
||||||
|
@ -683,6 +669,27 @@ class projectPlanner(wx.Frame):
|
||||||
self.selection.updateModelTransform()
|
self.selection.updateModelTransform()
|
||||||
self.preview.Refresh()
|
self.preview.Refresh()
|
||||||
|
|
||||||
|
def getExtraHeadSize(self):
|
||||||
|
extraSizeMin = self.headSizeMin
|
||||||
|
extraSizeMax = self.headSizeMax
|
||||||
|
if profile.getProfileSettingFloat('skirt_line_count') > 0:
|
||||||
|
skirtSize = profile.getProfileSettingFloat('skirt_line_count') * profile.calculateEdgeWidth() + profile.getProfileSettingFloat('skirt_gap')
|
||||||
|
extraSizeMin = extraSizeMin + numpy.array([skirtSize, skirtSize, 0])
|
||||||
|
extraSizeMax = extraSizeMax + numpy.array([skirtSize, skirtSize, 0])
|
||||||
|
if profile.getProfileSetting('enable_raft') != 'False':
|
||||||
|
raftSize = profile.getProfileSettingFloat('raft_margin') * 2
|
||||||
|
extraSizeMin = extraSizeMin + numpy.array([raftSize, raftSize, 0])
|
||||||
|
extraSizeMax = extraSizeMax + numpy.array([raftSize, raftSize, 0])
|
||||||
|
if profile.getProfileSetting('support') != 'None':
|
||||||
|
extraSizeMin = extraSizeMin + numpy.array([3.0, 0, 0])
|
||||||
|
extraSizeMax = extraSizeMax + numpy.array([3.0, 0, 0])
|
||||||
|
|
||||||
|
if self.printMode == 1:
|
||||||
|
extraSizeMin = numpy.array([6.0, 6.0, 0])
|
||||||
|
extraSizeMax = numpy.array([6.0, 6.0, 0])
|
||||||
|
|
||||||
|
return extraSizeMin, extraSizeMax
|
||||||
|
|
||||||
class PreviewGLCanvas(glcanvas.GLCanvas):
|
class PreviewGLCanvas(glcanvas.GLCanvas):
|
||||||
def __init__(self, parent, projectPlannerWindow):
|
def __init__(self, parent, projectPlannerWindow):
|
||||||
attribList = (glcanvas.WX_GL_RGBA, glcanvas.WX_GL_DOUBLEBUFFER, glcanvas.WX_GL_DEPTH_SIZE, 24, glcanvas.WX_GL_STENCIL_SIZE, 8)
|
attribList = (glcanvas.WX_GL_RGBA, glcanvas.WX_GL_DOUBLEBUFFER, glcanvas.WX_GL_DEPTH_SIZE, 24, glcanvas.WX_GL_STENCIL_SIZE, 8)
|
||||||
|
@ -770,19 +777,7 @@ class PreviewGLCanvas(glcanvas.GLCanvas):
|
||||||
def OnDraw(self):
|
def OnDraw(self):
|
||||||
machineSize = self.parent.machineSize
|
machineSize = self.parent.machineSize
|
||||||
opengl.DrawMachine(util3d.Vector3(machineSize[0], machineSize[1], machineSize[2]))
|
opengl.DrawMachine(util3d.Vector3(machineSize[0], machineSize[1], machineSize[2]))
|
||||||
extraSizeMin = self.parent.headSizeMin
|
extraSizeMin, extraSizeMax = self.parent.getExtraHeadSize()
|
||||||
extraSizeMax = self.parent.headSizeMax
|
|
||||||
if profile.getProfileSettingFloat('skirt_line_count') > 0:
|
|
||||||
skirtSize = profile.getProfileSettingFloat('skirt_line_count') * profile.calculateEdgeWidth() + profile.getProfileSettingFloat('skirt_gap')
|
|
||||||
extraSizeMin = extraSizeMin + numpy.array([skirtSize, skirtSize, 0])
|
|
||||||
extraSizeMax = extraSizeMax + numpy.array([skirtSize, skirtSize, 0])
|
|
||||||
if profile.getProfileSetting('support') != 'None':
|
|
||||||
extraSizeMin = extraSizeMin + numpy.array([3.0, 0, 0])
|
|
||||||
extraSizeMax = extraSizeMax + numpy.array([3.0, 0, 0])
|
|
||||||
|
|
||||||
if self.parent.printMode == 1:
|
|
||||||
extraSizeMin = numpy.array([6.0, 6.0, 0])
|
|
||||||
extraSizeMax = numpy.array([6.0, 6.0, 0])
|
|
||||||
|
|
||||||
for item in self.parent.list:
|
for item in self.parent.list:
|
||||||
item.validPlacement = True
|
item.validPlacement = True
|
||||||
|
|
Loading…
Reference in a new issue