Example #1
0
def getInfillDictionary(arounds,
                        aroundWidth,
                        infillInset,
                        infillWidth,
                        pixelTable,
                        rotatedLoops,
                        testLoops=None):
    'Get combined fill loops which include most of the points.'
    slightlyGreaterThanInfillInset = intercircle.globalIntercircleMultiplier * infillInset
    allPoints = intercircle.getPointsFromLoops(rotatedLoops, infillInset, 0.7)
    centers = intercircle.getCentersFromPoints(allPoints,
                                               slightlyGreaterThanInfillInset)
    infillDictionary = {}
    for center in centers:
        insetCenter = intercircle.getSimplifiedInsetFromClockwiseLoop(
            center, infillInset)
        insetPoint = insetCenter[0]
        if len(insetCenter) > 2 and intercircle.getIsLarge(
                insetCenter, infillInset) and euclidean.getIsInFilledRegion(
                    rotatedLoops, insetPoint):
            around = euclidean.getSimplifiedLoop(center, infillInset)
            euclidean.addLoopToPixelTable(around, pixelTable, aroundWidth)
            arounds.append(around)
            insetLoop = intercircle.getSimplifiedInsetFromClockwiseLoop(
                center, infillInset)
            euclidean.addXIntersectionsFromLoopForTable(
                insetLoop, infillDictionary, infillWidth)
            if testLoops != None:
                testLoops.append(insetLoop)
    return infillDictionary
Example #2
0
def getInfillDictionary(arounds, aroundWidth, infillInset, infillWidth, pixelTable, rotatedLoops, testLoops=None):
	'Get combined fill loops which include most of the points.'
	slightlyGreaterThanInfillInset = intercircle.globalIntercircleMultiplier * infillInset
	allPoints = intercircle.getPointsFromLoops(rotatedLoops, infillInset, 0.7)
	centers = intercircle.getCentersFromPoints(allPoints, slightlyGreaterThanInfillInset)
	infillDictionary = {}
	for center in centers:
		insetCenter = intercircle.getSimplifiedInsetFromClockwiseLoop(center, infillInset)
		insetPoint = insetCenter[0]
		if len(insetCenter) > 2 and intercircle.getIsLarge(insetCenter, infillInset) and euclidean.getIsInFilledRegion(rotatedLoops, insetPoint):
			around = euclidean.getSimplifiedLoop(center, infillInset)
			euclidean.addLoopToPixelTable(around, pixelTable, aroundWidth)
			arounds.append(around)
			insetLoop = intercircle.getSimplifiedInsetFromClockwiseLoop(center, infillInset)
			euclidean.addXIntersectionsFromLoopForTable(insetLoop, infillDictionary, infillWidth)
			if testLoops != None:
				testLoops.append(insetLoop)
	return infillDictionary
Example #3
0
 def getHorizontalXIntersectionsTable(self, loop):
     'Get the horizontal x intersections table from the loop.'
     horizontalXIntersectionsTable = {}
     euclidean.addXIntersectionsFromLoopForTable(
         loop, horizontalXIntersectionsTable, self.edgeWidth)
     return horizontalXIntersectionsTable
Example #4
0
 def getHorizontalXIntersectionsTable(self, loop):
     "Get the horizontal x intersections table from the loop."
     horizontalXIntersectionsTable = {}
     euclidean.addXIntersectionsFromLoopForTable(loop, horizontalXIntersectionsTable, self.perimeterWidth)
     return horizontalXIntersectionsTable