def addGcodeFromRemainingLoop(self, loop, loopLayer, loopLists, radius): "Add the remainder of the loop which does not overlap the alreadyFilledArounds loops." centerOutset = intercircle.getLargestCenterOutsetLoopFromLoopRegardless(loop, radius) euclidean.addNestedRingBeginning(self.distanceFeedRate, centerOutset.outset, loopLayer.z) self.addGcodePerimeterBlockFromRemainingLoop(centerOutset.center, loopLayer, loopLists, radius) self.distanceFeedRate.addLine('(</boundaryPerimeter>)') self.distanceFeedRate.addLine('(</nestedRing>)')
def addInset(self, nestedRing, halfWidth, alreadyFilledArounds): "Add inset to the layer." # Note: inner nested rings have to come first so the intersecting check below does not give a false positive for innerNestedRing in nestedRing.innerNestedRings: self.addInset(innerNestedRing, halfWidth, alreadyFilledArounds) boundary = [nestedRing.getXYBoundaries()] insetBoundaryPerimeter = intercircle.getInsetLoopsFromLoops(halfWidth, boundary) triangle_mesh.sortLoopsInOrderOfArea(not self.loopOrderAscendingArea, insetBoundaryPerimeter) for loop in insetBoundaryPerimeter: centerOutset = intercircle.getLargestCenterOutsetLoopFromLoopRegardless(loop, halfWidth) "Add the perimeter block remainder of the loop which does not overlap the alreadyFilledArounds loops." if self.overlapRemovalWidthOverPerimeterWidth < 0.1: nestedRing.perimeter.addPath(centerOutset.center + [centerOutset.center[0]]) break isIntersectingSelf = isIntersectingItself(centerOutset.center, self.overlapRemovalWidth) if isIntersectingWithinLists(centerOutset.center, alreadyFilledArounds) or isIntersectingSelf: self.addGcodeFromPerimeterPaths( nestedRing, isIntersectingSelf, centerOutset.center, alreadyFilledArounds, halfWidth, boundary ) else: nestedRing.perimeter.addPath(centerOutset.center + [centerOutset.center[0]]) addAlreadyFilledArounds(alreadyFilledArounds, centerOutset.center, self.overlapRemovalWidth)
def addGcodeFromRemainingLoop(self, loop, loopLists, radius, rotatedLoopLayer): "Add the remainder of the loop which does not overlap the alreadyFilledArounds loops." centerOutset = intercircle.getLargestCenterOutsetLoopFromLoopRegardless(loop, radius) euclidean.addNestedRingBeginning(self.distanceFeedRate, centerOutset.outset, rotatedLoopLayer.z) self.addGcodePerimeterBlockFromRemainingLoop(centerOutset.center, loopLists, radius, rotatedLoopLayer) self.distanceFeedRate.addLine('(</boundaryPerimeter>)') self.distanceFeedRate.addLine('(</nestedRing>)')
def addGcodeFromRemainingLoop( self, loop, loopLists, radius, z ): "Add the remainder of the loop which does not overlap the alreadyFilledArounds loops." # boundary = intercircle.getLargestInsetLoopFromLoopRegardless( loop, - radius ) # loop = euclidean.getSimplifiedLoop( intercircle.getCentersFromLoopDirection( euclidean.isWiddershins(loop), loop, radius )[0], radius ) # euclidean.addSurroundingLoopBeginning( self.distanceFeedRate, boundary, z ) # self.addGcodePerimeterBlockFromRemainingLoop( loop, loopLists, radius, z ) centerOutset = intercircle.getLargestCenterOutsetLoopFromLoopRegardless( loop, radius ) euclidean.addSurroundingLoopBeginning( self.distanceFeedRate, centerOutset.outset, z ) self.addGcodePerimeterBlockFromRemainingLoop( centerOutset.center, loopLists, radius, z ) # boundary = intercircle.getLargestInsetLoopFromLoopNoMatterWhat( loop, - radius ) # euclidean.addSurroundingLoopBeginning( self.distanceFeedRate, boundary, z ) # self.addGcodePerimeterBlockFromRemainingLoop( loop, loopLists, radius, z ) self.distanceFeedRate.addLine('(</boundaryPerimeter>)') self.distanceFeedRate.addLine('(</nestedRing>)')
def addGcodeFromRemainingLoop(self, loop, loopLists, radius, z): "Add the remainder of the loop which does not overlap the alreadyFilledArounds loops." # boundary = intercircle.getLargestInsetLoopFromLoopRegardless( loop, - radius ) # loop = euclidean.getSimplifiedLoop( intercircle.getCentersFromLoopDirection( euclidean.isWiddershins(loop), loop, radius )[0], radius ) # euclidean.addSurroundingLoopBeginning( self.distanceFeedRate, boundary, z ) # self.addGcodePerimeterBlockFromRemainingLoop( loop, loopLists, radius, z ) centerOutset = intercircle.getLargestCenterOutsetLoopFromLoopRegardless( loop, radius) euclidean.addSurroundingLoopBeginning(self.distanceFeedRate, centerOutset.outset, z) self.addGcodePerimeterBlockFromRemainingLoop(centerOutset.center, loopLists, radius, z) # boundary = intercircle.getLargestInsetLoopFromLoopNoMatterWhat( loop, - radius ) # euclidean.addSurroundingLoopBeginning( self.distanceFeedRate, boundary, z ) # self.addGcodePerimeterBlockFromRemainingLoop( loop, loopLists, radius, z ) self.distanceFeedRate.addLine('(</boundaryPerimeter>)') self.distanceFeedRate.addLine('(</nestedRing>)')
def addInset(self, nestedRing, halfWidth, alreadyFilledArounds): "Add inset to the layer." # Note: inner nested rings have to come first so the intersecting check below does not give a false positive for innerNestedRing in nestedRing.innerNestedRings: self.addInset(innerNestedRing, halfWidth, alreadyFilledArounds) boundary = [nestedRing.getXYBoundaries()] insetBoundaryPerimeter = intercircle.getInsetLoopsFromLoops( halfWidth, boundary) triangle_mesh.sortLoopsInOrderOfArea(not self.loopOrderAscendingArea, insetBoundaryPerimeter) for loop in insetBoundaryPerimeter: centerOutset = intercircle.getLargestCenterOutsetLoopFromLoopRegardless( loop, halfWidth) "Add the perimeter block remainder of the loop which does not overlap the alreadyFilledArounds loops." if self.overlapRemovalWidthOverPerimeterWidth < 0.1: nestedRing.perimeter.addPath(centerOutset.center + [centerOutset.center[0]]) break isIntersectingSelf = isIntersectingItself(centerOutset.center, self.overlapRemovalWidth) if isIntersectingWithinLists( centerOutset.center, alreadyFilledArounds) or isIntersectingSelf: self.addGcodeFromPerimeterPaths(nestedRing, isIntersectingSelf, centerOutset.center, alreadyFilledArounds, halfWidth, boundary) else: nestedRing.perimeter.addPath(centerOutset.center + [centerOutset.center[0]]) addAlreadyFilledArounds(alreadyFilledArounds, centerOutset.center, self.overlapRemovalWidth)