Change the way the only jump retraction works, this allows retraction when moving to print support.

master
Daid 2012-06-20 02:34:59 +02:00
parent 21a71f288e
commit dc194ea1c0
3 changed files with 18 additions and 14 deletions

View File

@ -238,7 +238,6 @@ class CombSkein:
def getAroundBetweenPath(self, begin, end):
'Get the path around the loops in the way of the original line segment.'
addedJumpLine = False
aroundBetweenPath = []
boundaries = self.getBoundaries()
boundarySegments = self.getBoundarySegments(begin, boundaries, end)
@ -246,9 +245,6 @@ class CombSkein:
segment = boundarySegment.segment
if boundarySegmentIndex < len(boundarySegments) - 1 and self.runningJumpSpace > 0.0:
segment = boundarySegment.getSegment(boundarySegmentIndex, boundarySegments, self.edgeWidth, self.runningJumpSpace)
if not addedJumpLine:
self.distanceFeedRate.addLine("(<nextmovehasspacejump>)")
addedJumpLine = True
aroundBetweenPath += self.getAroundBetweenLineSegment(segment[0], boundaries, segment[1])
if boundarySegmentIndex < len(boundarySegments) - 1:
aroundBetweenPath.append(segment[1])

View File

@ -192,7 +192,8 @@ class DimensionSkein:
self.totalExtrusionDistance = 0.0
self.travelFeedRatePerSecond = None
self.zDistanceRatio = 5.0
self.addRetraction = False
self.addRetraction = True
self.reverseRetraction = False
self.onlyRetractOnJumps = True
def addLinearMoveExtrusionDistanceLine(self, extrusionDistance):
@ -383,10 +384,15 @@ class DimensionSkein:
self.absoluteDistanceMode = True
elif firstWord == 'G91':
self.absoluteDistanceMode = False
elif firstWord == '(<nextmovehasspacejump>)' and self.onlyRetractOnJumps:
#Check for the space jump moves for retraction, these tags are added by the comb plugin.
self.addLinearMoveExtrusionDistanceLine(-self.repository.retractionDistance.value * self.retractionRatio)
self.addRetraction = True
elif firstWord == '(<nestedRing>)':
if self.onlyRetractOnJumps:
self.addRetraction = False
elif firstWord == '(</nestedRing>)':
if self.onlyRetractOnJumps:
self.addRetraction = True
self.retractionRatio = self.getRetractionRatio(lineIndex)
self.addLinearMoveExtrusionDistanceLine(-self.repository.retractionDistance.value * self.retractionRatio)
self.reverseRetraction = True
elif firstWord == '(<layer>':
self.layerIndex += 1
settings.printProgress(self.layerIndex, 'dimension')
@ -395,9 +401,9 @@ class DimensionSkein:
self.distanceFeedRate.addLine('G92 E0')
self.totalExtrusionDistance = 0.0
elif firstWord == 'M101':
if self.addRetraction or not self.onlyRetractOnJumps:
if self.reverseRetraction:
self.addLinearMoveExtrusionDistanceLine(self.restartDistance * self.retractionRatio)
self.addRetraction = False
self.reverseRetraction = False
if self.totalExtrusionDistance > self.repository.maximumEValueBeforeReset.value:
if not self.repository.relativeExtrusionDistance.value:
self.distanceFeedRate.addLine('G92 E0')
@ -405,8 +411,9 @@ class DimensionSkein:
self.isExtruderActive = True
elif firstWord == 'M103':
self.retractionRatio = self.getRetractionRatio(lineIndex)
if not self.onlyRetractOnJumps:
if self.addRetraction:
self.addLinearMoveExtrusionDistanceLine(-self.repository.retractionDistance.value * self.retractionRatio)
self.reverseRetraction = True
self.isExtruderActive = False
elif firstWord == 'M108':
self.flowRate = float( splitLine[1][1 :] )

View File

@ -228,7 +228,7 @@ def DrawGCodeLayer(layer):
fillCycle = 0
fillColorCycle = [[0.5,0.5,0.0],[0.0,0.5,0.5],[0.5,0.0,0.5]]
moveColor = [0,0,1]
retractColor = [0,1,1]
retractColor = [1,0,0.5]
supportColor = [0,1,1]
extrudeColor = [1,0,0]
innerWallColor = [0,1,0]
@ -312,7 +312,8 @@ def DrawGCodeLayer(layer):
for v in path.list:
glVertex3f(v.x, v.y, v.z)
glEnd()
prevPathWasRetract = False
if not path.type == 'move':
prevPathWasRetract = False
if path.type == 'retract' and path.list[0].almostEqual(path.list[-1]):
prevPathWasRetract = True
glEnable(GL_CULL_FACE)