Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Ferdi van der Werf 2012-04-23 12:52:16 +02:00
commit 3a9efc3de1
5 changed files with 28 additions and 19 deletions

View file

@ -3,7 +3,7 @@ G92 E0
G1 Z{clear_z} E-5 F{max_z_speed} G1 Z{clear_z} E-5 F{max_z_speed}
G92 E0 G92 E0
G1 X{machine_center_x} Y{machine_center_y} F{travel_speed} G1 X{machine_center_x} Y{machine_center_y} F{travel_speed}
G1 F200 E6.5 G1 F200 E5.5
G92 E0 G92 E0
G1 Z0 F{max_z_speed} G1 Z0 F{max_z_speed}

View file

@ -448,6 +448,7 @@ def getLoopsFromCorrectMesh( edges, faces, vertexes, z ):
p0 = loop[-1] p0 = loop[-1]
for p1 in loop: for p1 in loop:
if euclidean.isLineIntersectingLoops(loops[idx+1:], p0, p1): if euclidean.isLineIntersectingLoops(loops[idx+1:], p0, p1):
if not warning:
print('Warning, the triangle mesh slice intersects itself in getLoopsFromCorrectMesh in triangle_mesh.') print('Warning, the triangle mesh slice intersects itself in getLoopsFromCorrectMesh in triangle_mesh.')
print('Model error(intersect): (%f, %f, %f) (%f, %f, %f)' % (p0.real, p0.imag, z, p1.real, p1.imag, z)) print('Model error(intersect): (%f, %f, %f) (%f, %f, %f)' % (p0.real, p0.imag, z, p1.real, p1.imag, z))
warning = True warning = True

View file

@ -189,10 +189,6 @@ class settingNotify():
self.func = func self.func = func
def validate(self): def validate(self):
try:
f = float(self.setting.GetValue())
self.func(f)
return validators.SUCCESS, ''
except ValueError:
self.func() self.func()
return validators.SUCCESS, '' return validators.SUCCESS, ''

View file

@ -236,6 +236,13 @@ class projectPlanner(wx.Frame):
self.preview.Refresh() self.preview.Refresh()
def _doAutoPlace(self, allowedSizeY): def _doAutoPlace(self, allowedSizeY):
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 - util3d.Vector3(skirtSize, skirtSize, 0)
extraSizeMax = extraSizeMax + util3d.Vector3(skirtSize, skirtSize, 0)
posX = self.machineSize.x posX = self.machineSize.x
posY = 0 posY = 0
minX = self.machineSize.x minX = self.machineSize.x
@ -248,11 +255,11 @@ class projectPlanner(wx.Frame):
item.centerX = posX + item.getMaximum().x * item.scale * dirX item.centerX = posX + item.getMaximum().x * item.scale * dirX
item.centerY = posY + item.getMaximum().y * item.scale * dirY item.centerY = posY + item.getMaximum().y * item.scale * dirY
if item.centerY + item.getSize().y >= allowedSizeY: if item.centerY + item.getSize().y >= allowedSizeY:
posX = minX - self.headSizeMax.x - 1 posX = minX - extraSizeMax.x - 1
posY = 0 posY = 0
item.centerX = posX + item.getMaximum().x * item.scale * dirX item.centerX = posX + item.getMaximum().x * item.scale * dirX
item.centerY = posY + item.getMaximum().y * item.scale * dirY item.centerY = posY + item.getMaximum().y * item.scale * dirY
posY += item.getSize().y * item.scale * dirY + self.headSizeMin.y + 1 posY += item.getSize().y * item.scale * dirY + extraSizeMin.y + 1
minX = min(minX, item.centerX - item.getSize().x * item.scale / 2) minX = min(minX, item.centerX - item.getSize().x * item.scale / 2)
minY = min(minY, item.centerY - item.getSize().y * item.scale / 2) minY = min(minY, item.centerY - item.getSize().y * item.scale / 2)
maxX = max(maxX, item.centerX + item.getSize().x * item.scale / 2) maxX = max(maxX, item.centerX + item.getSize().x * item.scale / 2)
@ -274,7 +281,6 @@ class projectPlanner(wx.Frame):
put('model_multiply_x', '1') put('model_multiply_x', '1')
put('model_multiply_y', '1') put('model_multiply_y', '1')
put('skirt_line_count', '0')
put('enable_raft', 'False') put('enable_raft', 'False')
put('add_start_end_gcode', 'False') put('add_start_end_gcode', 'False')
put('gcode_extension', 'project_tmp') put('gcode_extension', 'project_tmp')
@ -505,6 +511,12 @@ class PreviewGLCanvas(glcanvas.GLCanvas):
def OnDraw(self): def OnDraw(self):
machineSize = self.parent.machineSize machineSize = self.parent.machineSize
opengl.DrawMachine(machineSize) opengl.DrawMachine(machineSize)
extraSizeMin = self.parent.headSizeMin
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 - util3d.Vector3(skirtSize, skirtSize, 0)
extraSizeMax = extraSizeMax + util3d.Vector3(skirtSize, skirtSize, 0)
for item in self.parent.list: for item in self.parent.list:
item.validPlacement = True item.validPlacement = True
@ -512,8 +524,8 @@ class PreviewGLCanvas(glcanvas.GLCanvas):
for idx1 in xrange(0, len(self.parent.list)): for idx1 in xrange(0, len(self.parent.list)):
item = self.parent.list[idx1] item = self.parent.list[idx1]
iMin1 = item.getMinimum() * item.scale + util3d.Vector3(item.centerX, item.centerY, 0) - self.parent.headSizeMin iMin1 = item.getMinimum() * item.scale + util3d.Vector3(item.centerX, item.centerY, 0) - extraSizeMin
iMax1 = item.getMaximum() * item.scale + util3d.Vector3(item.centerX, item.centerY, 0) + self.parent.headSizeMax iMax1 = item.getMaximum() * item.scale + util3d.Vector3(item.centerX, item.centerY, 0) + extraSizeMax
for idx2 in xrange(0, idx1): for idx2 in xrange(0, idx1):
item2 = self.parent.list[idx2] item2 = self.parent.list[idx2]
iMin2 = item2.getMinimum() * item2.scale + util3d.Vector3(item2.centerX, item2.centerY, 0) iMin2 = item2.getMinimum() * item2.scale + util3d.Vector3(item2.centerX, item2.centerY, 0)
@ -561,8 +573,8 @@ class PreviewGLCanvas(glcanvas.GLCanvas):
vMin = item.getMinimum() * item.scale vMin = item.getMinimum() * item.scale
vMax = item.getMaximum() * item.scale vMax = item.getMaximum() * item.scale
vMinHead = vMin - self.parent.headSizeMin vMinHead = vMin - extraSizeMin
vMaxHead = vMax + self.parent.headSizeMax vMaxHead = vMax + extraSizeMax
glDisable(GL_LIGHTING) glDisable(GL_LIGHTING)

View file

@ -17,7 +17,7 @@ profileDefaultSettings = {
'solid_layer_thickness': '0.6', 'solid_layer_thickness': '0.6',
'fill_density': '20', 'fill_density': '20',
'skirt_line_count': '1', 'skirt_line_count': '1',
'skirt_gap': '6.0', 'skirt_gap': '3.0',
'print_speed': '50', 'print_speed': '50',
'print_temperature': '0', 'print_temperature': '0',
'support': 'None', 'support': 'None',
@ -30,8 +30,8 @@ profileDefaultSettings = {
'retraction_amount': '0.0', 'retraction_amount': '0.0',
'retraction_extra': '0.0', 'retraction_extra': '0.0',
'travel_speed': '150', 'travel_speed': '150',
'max_z_speed': '1.0', 'max_z_speed': '3.0',
'bottom_layer_speed': '25', 'bottom_layer_speed': '20',
'cool_min_layer_time': '10', 'cool_min_layer_time': '10',
'fan_enabled': 'True', 'fan_enabled': 'True',
'fan_layer': '0', 'fan_layer': '0',