Exemple #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 = 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)
Exemple #2
0
	def setCorners( self ):
		"Set maximum and minimum corners and z."
		locationComplexes = []
		for line in self.lines[self.lineIndex :]:
			splitLine = gcodec.getSplitLineBeforeBracketSemicolon(line)
			firstWord = gcodec.getFirstWord( splitLine )
			if firstWord == 'G1':
				location = gcodec.getLocationFromSplitLine( self.oldLocation, splitLine )
				locationComplexes.append( location.dropAxis( 2 ) )
				self.oldLocation = location
		cornerHighComplex = euclidean.getMaximumFromPoints( locationComplexes )
		cornerLowComplex = euclidean.getMinimumFromPoints( locationComplexes )
		self.extent = cornerHighComplex - cornerLowComplex
		self.shapeCenter = 0.5 * ( cornerHighComplex + cornerLowComplex )
		self.separation = self.multiplyRepository.separationOverPerimeterWidth.value * self.absolutePerimeterWidth
		self.extentPlusSeparation = self.extent + complex( self.separation, self.separation )
		columnsMinusOne = self.numberOfColumns - 1
		rowsMinusOne = self.numberOfRows - 1
		self.arrayExtent = complex( self.extentPlusSeparation.real * columnsMinusOne, self.extentPlusSeparation.imag * rowsMinusOne )
		self.arrayCenter = 0.5 * self.arrayExtent
Exemple #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 )
 def setCorners(self):
     "Set maximum and minimum corners and z."
     locationComplexes = []
     for line in self.lines[self.lineIndex:]:
         splitLine = gcodec.getSplitLineBeforeBracketSemicolon(line)
         firstWord = gcodec.getFirstWord(splitLine)
         if firstWord == 'G1':
             location = gcodec.getLocationFromSplitLine(
                 self.oldLocation, splitLine)
             locationComplexes.append(location.dropAxis(2))
             self.oldLocation = location
     cornerHighComplex = euclidean.getMaximumFromPoints(locationComplexes)
     cornerLowComplex = euclidean.getMinimumFromPoints(locationComplexes)
     self.extent = cornerHighComplex - cornerLowComplex
     self.shapeCenter = 0.5 * (cornerHighComplex + cornerLowComplex)
     self.separation = self.multiplyRepository.separationOverPerimeterWidth.value * self.absolutePerimeterWidth
     self.extentPlusSeparation = self.extent + complex(
         self.separation, self.separation)
     columnsMinusOne = self.numberOfColumns - 1
     rowsMinusOne = self.numberOfRows - 1
     self.arrayExtent = complex(
         self.extentPlusSeparation.real * columnsMinusOne,
         self.extentPlusSeparation.imag * rowsMinusOne)
     self.arrayCenter = 0.5 * self.arrayExtent
Exemple #5
0
 def getFromLoop(self, loop):
     "Get the bounding loop from a path."
     self.loop = loop
     self.maximum = euclidean.getMaximumFromPoints(loop)
     self.minimum = euclidean.getMinimumFromPoints(loop)
     return self
	def getFromLoop( self, loop ):
		"Get the bounding loop from a path."
		self.loop = loop
		self.maximum = euclidean.getMaximumFromPoints( loop )
		self.minimum = euclidean.getMinimumFromPoints( loop )
		return self