Example #1
0
 def getUnpausedArcMovement(self, line, splitLine):
     "Get an unpaused arc movement."
     if self.oldLocation == None:
         return line
     self.feedRateMinute = gcodec.getFeedRateMinute(self.feedRateMinute,
                                                    splitLine)
     relativeLocation = gcodec.getLocationFromSplitLine(
         self.oldLocation, splitLine)
     location = self.oldLocation + relativeLocation
     self.oldLocation = location
     halfPlaneLineDistance = 0.5 * abs(relativeLocation.dropAxis(2))
     radius = gcodec.getDoubleFromCharacterSplitLine('R', splitLine)
     if radius == None:
         relativeCenter = complex(
             gcodec.getDoubleFromCharacterSplitLine('I', splitLine),
             gcodec.getDoubleFromCharacterSplitLine('J', splitLine))
         radius = abs(relativeCenter)
     angle = 0.0
     if radius > 0.0:
         angle = math.pi
         if halfPlaneLineDistance < radius:
             angle = 2.0 * math.asin(halfPlaneLineDistance / radius)
         else:
             angle *= halfPlaneLineDistance / radius
     deltaZ = abs(relativeLocation.z)
     arcDistanceZ = complex(abs(angle) * radius, relativeLocation.z)
     distance = abs(arcDistanceZ)
     if distance <= 0.0:
         return ''
     unpausedFeedRateMinute = self.distanceFeedRate.getZLimitedFeedRate(
         deltaZ, distance, self.feedRateMinute)
     return self.distanceFeedRate.getLineWithFeedRate(
         unpausedFeedRateMinute, line, splitLine)
Example #2
0
 def getDimensionedArcMovement(self, line, splitLine):
     "Get a dimensioned arc movement."
     if self.oldLocation == None:
         return line
     relativeLocation = gcodec.getLocationFromSplitLine(
         self.oldLocation, splitLine)
     location = self.oldLocation + relativeLocation
     self.oldLocation = location
     halfPlaneLineDistance = 0.5 * abs(relativeLocation.dropAxis(2))
     radius = gcodec.getDoubleFromCharacterSplitLine('R', splitLine)
     if radius == None:
         relativeCenter = complex(
             gcodec.getDoubleFromCharacterSplitLine('I', splitLine),
             gcodec.getDoubleFromCharacterSplitLine('J', splitLine))
         radius = abs(relativeCenter)
     angle = 0.0
     if radius > 0.0:
         angle = math.pi
         if halfPlaneLineDistance < radius:
             angle = 2.0 * math.asin(halfPlaneLineDistance / radius)
         else:
             angle *= halfPlaneLineDistance / radius
     deltaZ = abs(relativeLocation.z)
     arcDistanceZ = complex(abs(angle) * radius, relativeLocation.z)
     distance = abs(arcDistanceZ)
     return line + self.getExtrusionDistanceString(distance, splitLine)
Example #3
0
	def getUnpausedArcMovement( self, line, splitLine ):
		"Get an unpaused arc movement."
		if self.oldLocation == None:
			return line
		self.feedRateMinute = gcodec.getFeedRateMinute( self.feedRateMinute, splitLine )
		relativeLocation = gcodec.getLocationFromSplitLine(self.oldLocation, splitLine)
		location = self.oldLocation + relativeLocation
		self.oldLocation = location
		halfPlaneLineDistance = 0.5 * abs( relativeLocation.dropAxis(2) )
		radius = gcodec.getDoubleFromCharacterSplitLine('R', splitLine )
		if radius == None:
			relativeCenter = complex( gcodec.getDoubleFromCharacterSplitLine('I', splitLine ), gcodec.getDoubleFromCharacterSplitLine('J', splitLine ) )
			radius = abs( relativeCenter )
		angle = 0.0
		if radius > 0.0:
			angle = math.pi
			if halfPlaneLineDistance < radius:
				angle = 2.0 * math.asin( halfPlaneLineDistance / radius )
			else:
				angle *= halfPlaneLineDistance / radius
		deltaZ = abs( relativeLocation.z )
		arcDistanceZ = complex( abs(angle) * radius, relativeLocation.z )
		distance = abs( arcDistanceZ )
		if distance <= 0.0:
			return ''
		unpausedFeedRateMinute = self.distanceFeedRate.getZLimitedFeedRate( deltaZ, distance, self.feedRateMinute )
		return self.distanceFeedRate.getLineWithFeedRate( unpausedFeedRateMinute, line, splitLine )
Example #4
0
 def getDimensionedArcMovement(self, line, splitLine):
     "Get a dimensioned arc movement."
     if self.oldLocation == None:
         return line
     relativeLocation = gcodec.getLocationFromSplitLine(self.oldLocation, splitLine)
     location = self.oldLocation + relativeLocation
     self.oldLocation = location
     halfPlaneLineDistance = 0.5 * abs(relativeLocation.dropAxis(2))
     radius = gcodec.getDoubleFromCharacterSplitLine("R", splitLine)
     if radius == None:
         relativeCenter = complex(
             gcodec.getDoubleFromCharacterSplitLine("I", splitLine),
             gcodec.getDoubleFromCharacterSplitLine("J", splitLine),
         )
         radius = abs(relativeCenter)
     angle = 0.0
     if radius > 0.0:
         angle = math.pi
         if halfPlaneLineDistance < radius:
             angle = 2.0 * math.asin(halfPlaneLineDistance / radius)
         else:
             angle *= halfPlaneLineDistance / radius
     deltaZ = abs(relativeLocation.z)
     arcDistanceZ = complex(abs(angle) * radius, relativeLocation.z)
     distance = abs(arcDistanceZ)
     return line + self.getExtrusionDistanceString(distance, splitLine)