Exemplo n.º 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
def getExtraFillLoops(loops, radius):
    'Get extra loops between inside and outside loops. Extra perimeters'
    greaterThanRadius = radius / 0.7853  #todo was  *1.4 ACT (radius /0.7853)  how much the tight spots are covered by the extra loops
    extraFillLoops = []
    centers = intercircle.getCentersFromPoints(intercircle.getPointsFromLoops(loops, greaterThanRadius), greaterThanRadius)
    for center in centers:
        inset = intercircle.getSimplifiedInsetFromClockwiseLoop(center, radius)
        if intercircle.isLargeSameDirection(inset, center, radius):
            if euclidean.getIsInFilledRegion(loops, euclidean.getLeftPoint(inset)):
                inset.reverse()
                extraFillLoops.append(inset)
    return extraFillLoops
Exemplo n.º 3
0
def getExtraFillLoops(loops, radius):
    'Get extra loops between inside and outside loops. Extra perimeters'
    greaterThanRadius = radius / 0.7853  #todo was  *1.4 ACT (radius /0.7853)  how much the tight spots are covered by the extra loops
    extraFillLoops = []
    centers = intercircle.getCentersFromPoints(
        intercircle.getPointsFromLoops(loops, greaterThanRadius),
        greaterThanRadius)
    for center in centers:
        inset = intercircle.getSimplifiedInsetFromClockwiseLoop(center, radius)
        if intercircle.isLargeSameDirection(inset, center, radius):
            if euclidean.getIsInFilledRegion(loops,
                                             euclidean.getLeftPoint(inset)):
                inset.reverse()
                extraFillLoops.append(inset)
    return extraFillLoops
Exemplo n.º 4
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