chiark / gitweb /
Only retract on space jumps, saves a lot of needless retractions.
authordaid <daid303@gmail.com>
Thu, 12 Apr 2012 10:23:34 +0000 (12:23 +0200)
committerdaid <daid303@gmail.com>
Thu, 12 Apr 2012 10:23:34 +0000 (12:23 +0200)
Cura/cura_sf/skeinforge_application/skeinforge_plugins/craft_plugins/comb.py
Cura/cura_sf/skeinforge_application/skeinforge_plugins/craft_plugins/dimension.py

index 665f7bfc7af04d1543c9aa6a4b1ff47e3d04b783..8f98e985e23a2f7c40569efaa0fc6813c22f4f59 100644 (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])
index 0d16a9c72efcb243ac901ce5af73fb4f487d812f..ce89001e4d1459ad33afb89f3e0da4f2d6615510 100644 (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 :] )