Exemplo n.º 1
0
 def addCoolOrbits(self, remainingOrbitTime):
     'Add the minimum radius cool orbits.'
     if len(self.boundaryLayer.loops) < 1:
         return
     insetBoundaryLoops = intercircle.getInsetLoopsFromLoops(
         self.perimeterWidth, self.boundaryLayer.loops)
     if len(insetBoundaryLoops) < 1:
         insetBoundaryLoops = self.boundaryLayer.loops
     largestLoop = euclidean.getLargestLoop(insetBoundaryLoops)
     loopArea = euclidean.getAreaLoopAbsolute(largestLoop)
     if loopArea < self.minimumArea:
         center = 0.5 * (euclidean.getMaximumByComplexPath(largestLoop) +
                         euclidean.getMinimumByComplexPath(largestLoop))
         centerXBounded = max(center.real,
                              self.boundingRectangle.cornerMinimum.real)
         centerXBounded = min(centerXBounded,
                              self.boundingRectangle.cornerMaximum.real)
         centerYBounded = max(center.imag,
                              self.boundingRectangle.cornerMinimum.imag)
         centerYBounded = min(centerYBounded,
                              self.boundingRectangle.cornerMaximum.imag)
         center = complex(centerXBounded, centerYBounded)
         maximumCorner = center + self.halfCorner
         minimumCorner = center - self.halfCorner
         largestLoop = euclidean.getSquareLoopWiddershins(
             minimumCorner, maximumCorner)
     pointComplex = euclidean.getXYComplexFromVector3(self.oldLocation)
     if pointComplex != None:
         largestLoop = euclidean.getLoopStartingNearest(
             self.perimeterWidth, pointComplex, largestLoop)
     intercircle.addOrbitsIfLarge(self.distanceFeedRate, largestLoop,
                                  self.orbitalFeedRatePerSecond,
                                  remainingOrbitTime, self.highestZ)
Exemplo n.º 2
0
Arquivo: cool.py Projeto: Ademan/Cura
	def addCoolOrbits(self, remainingOrbitTime):
		'Add the minimum radius cool orbits.'
		if len(self.boundaryLayer.loops) < 1:
			return
		insetBoundaryLoops = self.boundaryLayer.loops
		if abs(self.repository.orbitalOutset.value) > 0.1 * abs(self.edgeWidth):
			insetBoundaryLoops = intercircle.getInsetLoopsFromLoops(self.boundaryLayer.loops, -self.repository.orbitalOutset.value)
		if len(insetBoundaryLoops) < 1:
			insetBoundaryLoops = self.boundaryLayer.loops
		largestLoop = euclidean.getLargestLoop(insetBoundaryLoops)
		loopArea = euclidean.getAreaLoopAbsolute(largestLoop)
		if loopArea < self.minimumArea:
			center = 0.5 * (euclidean.getMaximumByComplexPath(largestLoop) + euclidean.getMinimumByComplexPath(largestLoop))
			centerXBounded = max(center.real, self.boundingRectangle.cornerMinimum.real)
			centerXBounded = min(centerXBounded, self.boundingRectangle.cornerMaximum.real)
			centerYBounded = max(center.imag, self.boundingRectangle.cornerMinimum.imag)
			centerYBounded = min(centerYBounded, self.boundingRectangle.cornerMaximum.imag)
			center = complex(centerXBounded, centerYBounded)
			maximumCorner = center + self.halfCorner
			minimumCorner = center - self.halfCorner
			largestLoop = euclidean.getSquareLoopWiddershins(minimumCorner, maximumCorner)
		pointComplex = euclidean.getXYComplexFromVector3(self.oldLocation)
		if pointComplex != None:
			largestLoop = euclidean.getLoopStartingClosest(self.edgeWidth, pointComplex, largestLoop)
		intercircle.addOrbitsIfLarge(
			self.distanceFeedRate, largestLoop, self.orbitalFeedRatePerSecond, remainingOrbitTime, self.highestZ)
Exemplo n.º 3
0
	def addCoolOrbits( self, remainingOrbitTime ):
		"Add the minimum radius cool orbits."
		if len( self.boundaryLayer.loops ) < 1:
			return
		insetBoundaryLoops = intercircle.getInsetLoopsFromLoops( self.perimeterWidth, self.boundaryLayer.loops )
		if len( insetBoundaryLoops ) < 1:
			insetBoundaryLoops = self.boundaryLayer.loops
		largestLoop = euclidean.getLargestLoop( insetBoundaryLoops )
		loopArea = abs( euclidean.getPolygonArea( largestLoop ) )
		if loopArea < self.minimumArea:
			center = 0.5 * ( euclidean.getMaximumFromPoints( largestLoop ) + euclidean.getMinimumFromPoints( largestLoop ) )
			centerXBounded = max( center.real, self.boundingRectangle.cornerMinimum.real )
			centerXBounded = min( centerXBounded, self.boundingRectangle.cornerMaximum.real )
			centerYBounded = max( center.imag, self.boundingRectangle.cornerMinimum.imag )
			centerYBounded = min( centerYBounded, self.boundingRectangle.cornerMaximum.imag )
			center = complex( centerXBounded, centerYBounded )
			maximumCorner = center + self.halfCorner
			minimumCorner = center - self.halfCorner
			largestLoop = euclidean.getSquareLoop( minimumCorner, maximumCorner )
		pointComplex = euclidean.getXYComplexFromVector3( self.oldLocation )
		if pointComplex != None:
			largestLoop = euclidean.getLoopStartingNearest( self.perimeterWidth, pointComplex, largestLoop )
		intercircle.addOrbitsIfLarge( self.distanceFeedRate, largestLoop, self.orbitalFeedRatePerSecond, remainingOrbitTime, self.highestZ )