Пример #1
0
def getHorizontalSegments( fillLoops, alreadyFilledArounds, y ):
	"Get horizontal segments inside loops."
	solidXIntersectionList = []
	euclidean.addXIntersectionsFromLoops( fillLoops, - 1, solidXIntersectionList, y )
	for alreadyFilledAroundIndex in range( len( alreadyFilledArounds ) ):
		alreadyFilledLoops = alreadyFilledArounds[ alreadyFilledAroundIndex ]
		for alreadyFilledLoopIndex in range( len( alreadyFilledLoops ) ):
			alreadyFilledLoop = alreadyFilledLoops[ alreadyFilledLoopIndex ]
			euclidean.addXIntersections( alreadyFilledLoop, alreadyFilledAroundIndex, solidXIntersectionList, y )
	return euclidean.getSegmentsFromIntersections( solidXIntersectionList, y, fillLoops[ 0 ][ 0 ].z )
Пример #2
0
def getHorizontalSegments(fillLoops, alreadyFilledArounds, y):
    "Get horizontal segments inside loops."
    solidXIntersectionList = []
    euclidean.addXIntersectionsFromLoops(fillLoops, -1, solidXIntersectionList,
                                         y)
    for alreadyFilledAroundIndex in range(len(alreadyFilledArounds)):
        alreadyFilledLoops = alreadyFilledArounds[alreadyFilledAroundIndex]
        for alreadyFilledLoopIndex in range(len(alreadyFilledLoops)):
            alreadyFilledLoop = alreadyFilledLoops[alreadyFilledLoopIndex]
            euclidean.addXIntersections(alreadyFilledLoop,
                                        alreadyFilledAroundIndex,
                                        solidXIntersectionList, y)
    return euclidean.getSegmentsFromIntersections(solidXIntersectionList, y,
                                                  fillLoops[0][0].z)
Пример #3
0
def getSurroundingXIntersections( alreadyFilledSize, doubleSolidSurfaceThickness, surroundingSlices, y ):
	"Get x intersections from surrounding layers."
	if len( surroundingSlices ) < doubleSolidSurfaceThickness:
		return None
	joinedX = []
	solidXIntersectionList = []
	for surroundingIndex in range( len( surroundingSlices ) ):
		surroundingSlice = surroundingSlices[ surroundingIndex ]
		euclidean.addXIntersectionsFromLoops( surroundingSlice, surroundingIndex, joinedX, y )
	solidTable = {}
	solid = False
	joinedX.sort( euclidean.compareSolidXByX )
	for solidX in joinedX:
		solidXYInteger = int( solidX.imag )
		euclidean.toggleHashtable( solidTable, solidXYInteger, "" )
		oldSolid = solid
		solid = len( solidTable ) >= doubleSolidSurfaceThickness
		if oldSolid != solid:
			solidXIntersectionList.append( solidX.real )
	return solidXIntersectionList
Пример #4
0
def getSurroundingXIntersections(alreadyFilledSize,
                                 doubleSolidSurfaceThickness,
                                 surroundingSlices, y):
    "Get x intersections from surrounding layers."
    if len(surroundingSlices) < doubleSolidSurfaceThickness:
        return None
    joinedX = []
    solidXIntersectionList = []
    for surroundingIndex in range(len(surroundingSlices)):
        surroundingSlice = surroundingSlices[surroundingIndex]
        euclidean.addXIntersectionsFromLoops(surroundingSlice,
                                             surroundingIndex, joinedX, y)
    solidTable = {}
    solid = False
    joinedX.sort(euclidean.compareSolidXByX)
    for solidX in joinedX:
        solidXYInteger = int(solidX.imag)
        euclidean.toggleHashtable(solidTable, solidXYInteger, "")
        oldSolid = solid
        solid = len(solidTable) >= doubleSolidSurfaceThickness
        if oldSolid != solid:
            solidXIntersectionList.append(solidX.real)
    return solidXIntersectionList