コード例 #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.getAreaLoop(largestLoop))
     if loopArea < self.minimumArea:
         center = 0.5 * (euclidean.getMaximumByPathComplex(largestLoop) +
                         euclidean.getMinimumByPathComplex(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)
コード例 #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.getMaximumByPathComplex(
         locationComplexes)
     cornerLowComplex = euclidean.getMinimumByPathComplex(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
コード例 #3
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.getMaximumByPathComplex( locationComplexes )
		cornerLowComplex = euclidean.getMinimumByPathComplex( 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
コード例 #4
0
ファイル: cool.py プロジェクト: D1plo1d/ReplicatorG
	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.getAreaLoop( largestLoop ) )
		if loopArea < self.minimumArea:
			center = 0.5 * ( euclidean.getMaximumByPathComplex( largestLoop ) + euclidean.getMinimumByPathComplex( 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 )
コード例 #5
0
 def getFromLoop(self, loop):
     "Get the bounding loop from a path."
     self.loop = loop
     self.maximum = euclidean.getMaximumByPathComplex(loop)
     self.minimum = euclidean.getMinimumByPathComplex(loop)
     return self
コード例 #6
0
ファイル: intercircle.py プロジェクト: mccoyn/SkeinFactory
	def getFromLoop( self, loop ):
		"Get the bounding loop from a path."
		self.loop = loop
		self.maximum = euclidean.getMaximumByPathComplex(loop)
		self.minimum = euclidean.getMinimumByPathComplex(loop)
		return self