Only retract on space jumps, saves a lot of needless retractions.

master
daid 2012-04-12 12:23:34 +02:00
parent 1640b67c3b
commit b71180bb47
2 changed files with 12 additions and 2 deletions

View File

@ -238,6 +238,7 @@ 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)
@ -245,6 +246,9 @@ 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

@ -191,6 +191,7 @@ class DimensionSkein:
self.totalExtrusionDistance = 0.0
self.travelFeedRatePerSecond = None
self.zDistanceRatio = 5.0
self.addRetraction = False
def addLinearMoveExtrusionDistanceLine(self, extrusionDistance):
'Get the extrusion distance string from the extrusion distance.'
@ -379,11 +380,17 @@ class DimensionSkein:
self.absoluteDistanceMode = True
elif firstWord == 'G91':
self.absoluteDistanceMode = False
elif firstWord == '(<nextmovehasspacejump>)':
#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 == '(<layer>':
self.layerIndex += 1
settings.printProgress(self.layerIndex, 'dimension')
elif firstWord == 'M101':
self.addLinearMoveExtrusionDistanceLine(self.restartDistance * self.retractionRatio)
if self.addRetraction:
self.addLinearMoveExtrusionDistanceLine(self.restartDistance * self.retractionRatio)
self.addRetraction = False
if self.totalExtrusionDistance > self.repository.maximumEValueBeforeReset.value:
if not self.repository.relativeExtrusionDistance.value:
self.distanceFeedRate.addLine('G92 E0')
@ -391,7 +398,6 @@ class DimensionSkein:
self.isExtruderActive = True
elif firstWord == 'M103':
self.retractionRatio = self.getRetractionRatio(lineIndex)
self.addLinearMoveExtrusionDistanceLine(-self.repository.retractionDistance.value * self.retractionRatio)
self.isExtruderActive = False
elif firstWord == 'M108':
self.flowRate = float( splitLine[1][1 :] )