• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python gcodec.getLocationFromSplitLine函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中skeinforge_tools.skeinforge_utilities.gcodec.getLocationFromSplitLine函数的典型用法代码示例。如果您正苦于以下问题:Python getLocationFromSplitLine函数的具体用法?Python getLocationFromSplitLine怎么用?Python getLocationFromSplitLine使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getLocationFromSplitLine函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: parseLine

	def parseLine( self, line ):
		"Parse a gcode line and add it to the vector output."
		splitLine = gcodec.getSplitLineBeforeBracketSemicolon( line )
		if len( splitLine ) < 1:
			return
		firstWord = splitLine[ 0 ]
		if self.isLayerStart( firstWord, splitLine ):
			self.extrusionNumber = 0
			self.skeinPane = []
			self.skeinPanes.append( self.skeinPane )
		if firstWord == 'G1':
			location = gcodec.getLocationFromSplitLine( self.oldLocation, splitLine )
			self.linearMove( line, location )
			self.oldLocation = location
		elif firstWord == 'M101':
			self.extruderActive = True
			self.extrusionNumber += 1
		elif firstWord == 'M103':
			self.extruderActive = False
		if firstWord == 'G2' or firstWord == 'G3':
			relativeLocation = gcodec.getLocationFromSplitLine( self.oldLocation, splitLine )
			relativeLocation.z = 0.0
			location = self.oldLocation + relativeLocation
			self.linearMove( line, location )
			self.oldLocation = location
开发者ID:CNCBASHER,项目名称:skeinforge,代码行数:25,代码来源:skeinview.py


示例2: getDistanceToThreadBeginningAfterThreadEnd

	def getDistanceToThreadBeginningAfterThreadEnd( self, remainingDistance ):
		"Get the distance to the thread beginning after the end of this thread."
		extruderOnReached = False
		line = self.lines[ self.lineIndex ]
		splitLine = gcodec.getSplitLineBeforeBracketSemicolon( line )
		lastThreadLocation = gcodec.getLocationFromSplitLine( self.oldLocation, splitLine )
		threadEndReached = False
		totalDistance = 0.0
		for afterIndex in xrange( self.lineIndex + 1, len( self.lines ) ):
			line = self.lines[ afterIndex ]
			splitLine = gcodec.getSplitLineBeforeBracketSemicolon( line )
			firstWord = gcodec.getFirstWord( splitLine )
			if firstWord == 'G1':
				location = gcodec.getLocationFromSplitLine( lastThreadLocation, splitLine )
				if threadEndReached:
					totalDistance += location.distance( lastThreadLocation )
					if totalDistance >= remainingDistance:
						return None
					if extruderOnReached:
						return totalDistance
				lastThreadLocation = location
			elif firstWord == 'M101':
				extruderOnReached = True
			elif firstWord == 'M103':
				threadEndReached = True
		return None
开发者ID:CNCBASHER,项目名称:skeinforge,代码行数:26,代码来源:oozebane.py


示例3: setLayerPixelTable

	def setLayerPixelTable( self ):
		"Parse a gcode line and add it to the clip skein."
		boundaryLoop = None
		extruderActive = False
		maskPixelTable = {}
		self.boundaryLoops = []
		self.maskPixelTableTable = {}
		self.layerPixelTable = {}
		oldLocation = self.oldLocation
		for afterIndex in xrange( self.lineIndex + 1, len( self.lines ) ):
			line = self.lines[ afterIndex ]
			splitLine = gcodec.getSplitLineBeforeBracketSemicolon( line )
			firstWord = gcodec.getFirstWord( splitLine )
			if firstWord == 'G1':
				location = gcodec.getLocationFromSplitLine( oldLocation, splitLine )
				if extruderActive and oldLocation != None:
					self.addSegmentToPixelTables( location, maskPixelTable, oldLocation )
				oldLocation = location
			elif firstWord == 'M101':
				extruderActive = True
			elif firstWord == 'M103':
				extruderActive = False
				maskPixelTable = {}
			elif firstWord == '(</boundaryPerimeter>)':
				boundaryLoop = None
			elif firstWord == '(<boundaryPoint>':
				if boundaryLoop == None:
					boundaryLoop = []
					self.boundaryLoops.append( boundaryLoop )
				location = gcodec.getLocationFromSplitLine( None, splitLine )
				boundaryLoop.append( location.dropAxis( 2 ) )
			elif firstWord == '(</layer>)':
				return
开发者ID:FarMcKon,项目名称:skeinforge,代码行数:33,代码来源:clip.py


示例4: parseLine

	def parseLine( self, line ):
		"Parse a gcode line and add it to the inset skein."
		splitLine = gcodec.getSplitLineBeforeBracketSemicolon( line )
		if len( splitLine ) < 1:
			return
		firstWord = splitLine[ 0 ]
		if firstWord == '(<boundaryPoint>':
			location = gcodec.getLocationFromSplitLine( None, splitLine )
			self.boundary.append( location.dropAxis( 2 ) )
		elif ( firstWord == '(<bridgeRotation>' or firstWord == '<!--bridgeRotation-->' ):
			secondWordWithoutBrackets = splitLine[ 1 ].replace( '(', '' ).replace( ')', '' )
			self.rotatedBoundaryLayer.rotation = complex( secondWordWithoutBrackets )
		elif firstWord == '(</extrusion>)':
				self.distanceFeedRate.addLine( line )
				if self.repository.turnExtruderHeaterOffAtShutDown.value:
					self.distanceFeedRate.addLine( 'M104 S0' ) # Turn extruder heater off.
				return
		elif firstWord == '(<layer>':
			self.rotatedBoundaryLayer = euclidean.RotatedLoopLayer( float( splitLine[ 1 ] ) )
			self.distanceFeedRate.addLine( line )
		elif firstWord == '(</layer>)':
			self.addInset( self.rotatedBoundaryLayer )
			self.rotatedBoundaryLayer = None
		elif firstWord == '(<surroundingLoop>)':
			self.boundary = []
			self.rotatedBoundaryLayer.loops.append( self.boundary )
		if self.rotatedBoundaryLayer == None:
			self.distanceFeedRate.addLine( line )
开发者ID:CNCBASHER,项目名称:skeinforge,代码行数:28,代码来源:inset.py


示例5: getHopLine

	def getHopLine( self, line ):
		"Get hopped gcode line."
		splitLine = gcodec.getSplitLineBeforeBracketSemicolon( line )
		self.feedRateMinute = gcodec.getFeedRateMinute( self.feedRateMinute, splitLine )
		if self.extruderActive:
			return line
		location = gcodec.getLocationFromSplitLine( self.oldLocation, splitLine )
		highestZ = location.z
		if self.oldLocation != None:
			highestZ = max( highestZ, self.oldLocation.z )
		highestZHop = highestZ + self.hopHeight
		locationComplex = location.dropAxis( 2 )
		if self.justDeactivated:
			oldLocationComplex = self.oldLocation.dropAxis( 2 )
			distance = abs( locationComplex - oldLocationComplex )
			if distance < self.minimumDistance:
				if self.isNextTravel():
					return self.distanceFeedRate.getLineWithZ( line, splitLine, highestZHop )
			alongRatio = min( 0.41666666, self.hopDistance / distance )
			oneMinusAlong = 1.0 - alongRatio
			closeLocation = oldLocationComplex * oneMinusAlong + locationComplex * alongRatio
			self.distanceFeedRate.addLine( self.distanceFeedRate.getLineWithZ( line, splitLine, highestZHop ) )
			if self.isNextTravel():
				return self.distanceFeedRate.getLineWithZ( line, splitLine, highestZHop )
			farLocation = oldLocationComplex * alongRatio + locationComplex * oneMinusAlong
			self.distanceFeedRate.addGcodeMovementZWithFeedRate( self.feedRateMinute, farLocation, highestZHop )
			return line
		if self.isNextTravel():
			return self.distanceFeedRate.getLineWithZ( line, splitLine, highestZHop )
		return line
开发者ID:CNCBASHER,项目名称:skeinforge,代码行数:30,代码来源:hop.py


示例6: parseBoundaries

	def parseBoundaries( self ):
		"Parse the boundaries and add them to the boundary layers."
		boundaryLoop = None
		boundaryLayer = None
		for line in self.lines[ self.lineIndex : ]:
			splitLine = gcodec.getSplitLineBeforeBracketSemicolon( line )
			firstWord = gcodec.getFirstWord( splitLine )
			if len( self.shutdownLines ) > 0:
				self.shutdownLines.append( line )
			if firstWord == '(</boundaryPerimeter>)':
				boundaryLoop = None
			elif firstWord == '(<boundaryPoint>':
				location = gcodec.getLocationFromSplitLine( None, splitLine )
				if boundaryLoop == None:
					boundaryLoop = []
					boundaryLayer.loops.append( boundaryLoop )
				boundaryLoop.append( location.dropAxis( 2 ) )
			elif firstWord == '(<layer>':
				boundaryLayer = euclidean.LoopLayer( float( splitLine[ 1 ] ) )
				self.boundaryLayers.append( boundaryLayer )
			elif firstWord == '(</extrusion>)':
				self.shutdownLines = [ line ]
		for boundaryLayer in self.boundaryLayers:
			if not euclidean.isWiddershins( boundaryLayer.loops[ 0 ] ):
				boundaryLayer.loops[ 0 ].reverse()
		self.boundaryReverseLayers = self.boundaryLayers[ : ]
		self.boundaryReverseLayers.reverse()
开发者ID:CNCBASHER,项目名称:skeinforge,代码行数:27,代码来源:coil.py


示例7: getLinearMove

	def getLinearMove( self, line, splitLine ):
		"Get the linear move."
		location = gcodec.getLocationFromSplitLine( self.oldLocation, splitLine )
		self.movementLines.append( line )
		z = location.z + self.layerDeltas[ 0 ]
		self.oldLocation = location
		return self.distanceFeedRate.getLineWithZ( line, splitLine, z )
开发者ID:TeamTeamUSA,项目名称:SkeinFox,代码行数:7,代码来源:whittle.py


示例8: parseLine

	def parseLine( self, line ):
		"Parse a gcode line and add it to the mill skein."
		splitLine = gcodec.getSplitLineBeforeBracketSemicolon( line )
		if len( splitLine ) < 1:
			return
		firstWord = splitLine[ 0 ]
		if firstWord == 'G1':
			location = gcodec.getLocationFromSplitLine( self.oldLocation, splitLine )
			if self.isExtruderActive:
				self.average.addValue( location.z )
				if self.oldLocation != None:
					euclidean.addValueSegmentToPixelTable( self.oldLocation.dropAxis( 2 ), location.dropAxis( 2 ), self.aroundPixelTable, None, self.aroundWidth )
			self.oldLocation = location
		elif firstWord == 'M101':
			self.isExtruderActive = True
		elif firstWord == 'M103':
			self.isExtruderActive = False
		elif firstWord == '(<layer>':
			self.aroundPixelTable = {}
			self.average.reset()
		elif firstWord == '(</layer>)':
			if len( self.boundaryLayers ) > self.layerIndex:
				self.addMillThreads()
			self.layerIndex += 1
		self.distanceFeedRate.addLine( line )
开发者ID:CNCBASHER,项目名称:skeinforge,代码行数:25,代码来源:mill.py


示例9: parseSurroundingLoop

	def parseSurroundingLoop( self, line ):
		"Parse a surrounding loop."
		splitLine = gcodec.getSplitLineBeforeBracketSemicolon( line )
		if len( splitLine ) < 1:
			return
		firstWord = splitLine[ 0 ]
		if firstWord == 'G1':
			self.linearMove( splitLine )
		if firstWord == 'M101':
			self.extruderActive = True
		elif firstWord == 'M103':
			self.extruderActive = False
		elif firstWord == '(<boundaryPoint>':
			location = gcodec.getLocationFromSplitLine( None, splitLine )
			if self.boundary == None:
				self.boundary = []
			self.boundary.append( location.dropAxis( 2 ) )
		elif firstWord == '(<layer>':
			self.layerZ = float( splitLine[ 1 ] )
			self.threadLayer = None
		elif firstWord == '(<boundaryPerimeter>)':
			self.addThreadLayerIfNone()
		elif firstWord == '(</boundaryPerimeter>)':
			if self.boundary != None:
				self.threadLayer.points.append( getPolygonCenter( self.boundary ) )
				self.boundary = None
开发者ID:CNCBASHER,项目名称:skeinforge,代码行数:26,代码来源:drill.py


示例10: linearMove

	def linearMove( self, splitLine ):
		"Add a linear move to the loop."
		self.addThreadLayerIfNone()
		location = gcodec.getLocationFromSplitLine( self.oldLocation, splitLine )
		if self.extruderActive:
			self.boundary = None
		self.oldLocation = location
开发者ID:CNCBASHER,项目名称:skeinforge,代码行数:7,代码来源:drill.py


示例11: getUnpausedArcMovement

	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 )
开发者ID:CNCBASHER,项目名称:skeinforge,代码行数:27,代码来源:unpause.py


示例12: getTransferClosestSurroundingLoopLines

	def getTransferClosestSurroundingLoopLines( self, oldOrderedLocation, remainingSurroundingLoops ):
		"Get and transfer the closest remaining surrounding loop."
		if len( remainingSurroundingLoops ) > 0:
			oldOrderedLocation.z = remainingSurroundingLoops[ 0 ].z
		closestDistance = 999999999999999999.0
		closestSurroundingLoop = None
		for remainingSurroundingLoop in remainingSurroundingLoops:
			distance = euclidean.getNearestDistanceIndex( oldOrderedLocation.dropAxis( 2 ), remainingSurroundingLoop.boundary ).distance
			if distance < closestDistance:
				closestDistance = distance
				closestSurroundingLoop = remainingSurroundingLoop
		remainingSurroundingLoops.remove( closestSurroundingLoop )
		hasTravelledHighRoad = False
		for line in closestSurroundingLoop.lines:
			splitLine = gcodec.getSplitLineBeforeBracketSemicolon( line )
			firstWord = gcodec.getFirstWord( splitLine )
			if firstWord == 'G1':
				location = gcodec.getLocationFromSplitLine( self.oldLocation, splitLine )
				if not hasTravelledHighRoad:
					hasTravelledHighRoad = True
					self.addHighThread( location )
				if location.z > self.highestZ:
					self.highestZ = location.z
				self.oldLocation = location
			self.distanceFeedRate.addLine( line )
		return closestSurroundingLoop
开发者ID:CNCBASHER,项目名称:skeinforge,代码行数:26,代码来源:tower.py


示例13: getUnpausedArcMovement

	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 ''
		feedRateMinute = self.distanceFeedRate.getZLimitedFeedRate( deltaZ, distance, self.feedRateMinute )
		indexOfF = gcodec.indexOfStartingWithSecond( "F", splitLine )
		if indexOfF > 0 and feedRateMinute != self.feedRateMinute:
			feedRateStringOriginal = splitLine[ indexOfF ]
			feedRateStringReplacement = 'F' + self.distanceFeedRate.getRounded( feedRateMinute )
			return line.replace( feedRateStringOriginal, feedRateStringReplacement )
		return line
开发者ID:TeamTeamUSA,项目名称:SkeinFox,代码行数:32,代码来源:unpause.py


示例14: linearMove

	def linearMove( self, splitLine ):
		"Get statistics for a linear move."
		location = gcodec.getLocationFromSplitLine( self.oldLocation, splitLine )
		self.cornerMaximum = euclidean.getPointMaximum( self.cornerMaximum, location )
		self.cornerMinimum = euclidean.getPointMinimum( self.cornerMinimum, location )
		self.thread.append( location.dropAxis( 2 ) )
		self.oldLocation = location
开发者ID:TeamTeamUSA,项目名称:ReplicatorG,代码行数:7,代码来源:vectorwrite.py


示例15: getRelativeStretch

	def getRelativeStretch( self, locationComplex, lineIterator ):
		"Get relative stretch for a location."
		lastLocationComplex = locationComplex
		oldTotalLength = 0.0
		pointComplex = locationComplex
		totalLength = 0.0
		while 1:
			try:
				line = lineIterator.getNext()
			except StopIteration:
				locationMinusPoint = locationComplex - pointComplex
				locationMinusPointLength = abs( locationMinusPoint )
				if locationMinusPointLength > 0.0:
					return locationMinusPoint / locationMinusPointLength
				return complex()
			splitLine = gcodec.getSplitLineBeforeBracketSemicolon( line )
			firstWord = splitLine[ 0 ]
			pointComplex = gcodec.getLocationFromSplitLine( self.oldLocation, splitLine ).dropAxis( 2 )
			locationMinusPoint = lastLocationComplex - pointComplex
			locationMinusPointLength = abs( locationMinusPoint )
			totalLength += locationMinusPointLength
			if totalLength >= self.stretchFromDistance:
				distanceFromRatio = ( self.stretchFromDistance - oldTotalLength ) / locationMinusPointLength
				totalPoint = distanceFromRatio * pointComplex + ( 1.0 - distanceFromRatio ) * lastLocationComplex
				locationMinusTotalPoint = locationComplex - totalPoint
				return locationMinusTotalPoint / self.stretchFromDistance
			lastLocationComplex = pointComplex
			oldTotalLength = totalLength
开发者ID:FarMcKon,项目名称:skeinforge,代码行数:28,代码来源:stretch.py


示例16: getSplodgeLineGivenDistance

	def getSplodgeLineGivenDistance( self, feedRateMinute, line, liftOverExtraThickness, location, startupDistance ):
		"Add the splodge line."
		locationComplex = location.dropAxis( 2 )
		relativeStartComplex = None
		nextLocationComplex = self.getNextActiveLocationComplex()
		if nextLocationComplex != None:
			if nextLocationComplex != locationComplex:
				relativeStartComplex = locationComplex - nextLocationComplex
		if relativeStartComplex == None:
			relativeStartComplex = complex( 19.9, 9.9 )
			if self.oldLocation != None:
				oldLocationComplex = self.oldLocation.dropAxis( 2 )
				if oldLocationComplex != locationComplex:
					relativeStartComplex = oldLocationComplex - locationComplex
		relativeStartComplex *= startupDistance / abs( relativeStartComplex )
		startComplex = self.getStartInsideBoundingRectangle( locationComplex, relativeStartComplex )
		feedRateMultiplier = feedRateMinute / self.operatingFeedRatePerSecond / 60.0
		splodgeLayerThickness = self.layerThickness / math.sqrt( feedRateMultiplier )
		extraLayerThickness = splodgeLayerThickness - self.layerThickness
		lift = extraLayerThickness * liftOverExtraThickness
		startLine = self.distanceFeedRate.getLinearGcodeMovementWithFeedRate( self.feedRateMinute, startComplex, location.z + lift )
		self.addLineUnlessIdenticalReactivate( startLine )
		self.addLineUnlessIdenticalReactivate( 'M101' )
		splitLine = gcodec.getSplitLineBeforeBracketSemicolon( line )
		lineLocation = gcodec.getLocationFromSplitLine( self.oldLocation, splitLine )
		self.distanceFeedRate.addGcodeMovementZWithFeedRate( feedRateMinute, locationComplex, lineLocation.z + lift )
		return ''
开发者ID:CNCBASHER,项目名称:skeinforge,代码行数:27,代码来源:splodge.py


示例17: linearCorner

	def linearCorner( self, splitLine ):
		"Update the bounding corners."
		location = gcodec.getLocationFromSplitLine( self.oldLocation, splitLine )
		if self.extruderActive or self.goAroundExtruderOffTravel:
			self.cornerHigh = euclidean.getPointMaximum( self.cornerHigh, location )
			self.cornerLow = euclidean.getPointMinimum( self.cornerLow, location )
		self.oldLocation = location
开发者ID:TeamTeamUSA,项目名称:SkeinFox,代码行数:7,代码来源:behold.py


示例18: linearMove

	def linearMove( self, line, splitLine ):
		"Get statistics for a linear move."
		if self.skeinPane == None:
			return
		location = gcodec.getLocationFromSplitLine( self.oldLocation, splitLine )
		self.addToPath( line, location )
		self.oldLocation = location
开发者ID:TeamTeamUSA,项目名称:SkeinFox,代码行数:7,代码来源:behold.py


示例19: getDimensionedLinearMovement

	def getDimensionedLinearMovement( self, line, splitLine ):
		"Get an dimensioned linear movement."
		distance = 0.0
		if self.distanceFeedRate.absoluteDistanceMode:
			location = gcodec.getLocationFromSplitLine( self.oldLocation, splitLine )
			if self.oldLocation != None:
				distance = abs( location - self.oldLocation )
			self.oldLocation = location
		else:
			if self.oldLocation == None:
				print( 'Warning: There was no absolute location when the G91 command was parsed, so the absolute location will be set to the origin.' )
				self.oldLocation = Vector3()
			location = gcodec.getLocationFromSplitLine( None, splitLine )
			distance = abs( location )
			self.oldLocation += location
		return line + self.getExtrusionDistanceString( distance, splitLine )
开发者ID:CNCBASHER,项目名称:skeinforge,代码行数:16,代码来源:dimension.py


示例20: getAddShutSlowDownLine

	def getAddShutSlowDownLine( self, line ):
		"Add the shutdown and slowdown lines."
		if self.shutdownStepIndex >= len( self.earlyShutdownDistances ):
			self.shutdownStepIndex = len( self.earlyShutdownDistances ) + 99999999
			return False
		splitLine = gcodec.getSplitLineBeforeBracketSemicolon( line )
		distanceThreadEnd = self.getDistanceToExtruderOffCommand( self.earlyShutdownDistances[ self.shutdownStepIndex ] )
		location = gcodec.getLocationFromSplitLine( self.oldLocation, splitLine )
		if distanceThreadEnd == None:
			distanceThreadEnd = self.getDistanceToExtruderOffCommand( self.earlyShutdownDistances[ 0 ] )
			if distanceThreadEnd != None:
				shutdownFlowRateMultiplier = self.getShutdownFlowRateMultiplier( 1.0 - distanceThreadEnd / self.earlyShutdownDistance, len( self.earlyShutdownDistances ) )
				line = self.getLinearMoveWithFeedRate( self.feedRateMinute * shutdownFlowRateMultiplier, location )
			self.distanceFeedRate.addLine( line )
			return False
		segment = self.oldLocation - location
		segmentLength = segment.magnitude()
		distanceBack = self.earlyShutdownDistances[ self.shutdownStepIndex ] - distanceThreadEnd
		locationBack = location
		if segmentLength > 0.0:
			locationBack = location + segment * distanceBack / segmentLength
		if self.shutdownStepIndex == 0:
			if not self.isCloseToEither( locationBack, location, self.oldLocation ):
				line = self.getLinearMoveWithFeedRate( self.feedRateMinute, locationBack )
			self.distanceFeedRate.addLine( line )
			self.addLineSetShutdowns( 'M103' )
			return True
		if self.isClose( locationBack, self.oldLocation ):
			return True
		feedRate = self.feedRateMinute * self.earlyShutdownFlowRates[ self.shutdownStepIndex ]
		line = self.getLinearMoveWithFeedRate( feedRate, locationBack )
		if self.isClose( locationBack, location ):
			line = self.getLinearMoveWithFeedRate( feedRate, location )
		self.distanceFeedRate.addLine( line )
		return True
开发者ID:CNCBASHER,项目名称:skeinforge,代码行数:35,代码来源:oozebane.py



注:本文中的skeinforge_tools.skeinforge_utilities.gcodec.getLocationFromSplitLine函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python gcodec.getSplitLineBeforeBracketSemicolon函数代码示例发布时间:2022-05-27
下一篇:
Python gcodec.getFirstWord函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap