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)
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
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
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 )
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
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