def addAlreadyFilledArounds( alreadyFilledArounds, loop, radius ): "Add already filled loops around loop to alreadyFilledArounds." radius = abs( radius ) alreadyFilledLoop = [] slightlyGreaterThanRadius = 1.01 * radius muchGreaterThanRadius = 2.5 * radius centers = intercircle.getCentersFromLoop( loop, slightlyGreaterThanRadius ) for center in centers: alreadyFilledInset = intercircle.getSimplifiedInsetFromClockwiseLoop( center, radius ) if intercircle.isLargeSameDirection( alreadyFilledInset, center, radius ): alreadyFilledLoop.append( alreadyFilledInset ) if len( alreadyFilledLoop ) > 0: alreadyFilledArounds.append( alreadyFilledLoop )
def getBridgeLoops( layerThickness, loop ): "Get the inset bridge loops from the loop." halfWidth = 1.5 * layerThickness slightlyGreaterThanHalfWidth = 1.1 * halfWidth extrudateLoops = [] centers = intercircle.getCentersFromLoop( loop, slightlyGreaterThanHalfWidth ) for center in centers: extrudateLoop = intercircle.getSimplifiedInsetFromClockwiseLoop( center, halfWidth ) if intercircle.isLargeSameDirection( extrudateLoop, center, halfWidth ): if euclidean.isPathInsideLoop( loop, extrudateLoop ) == euclidean.isWiddershins( loop ): extrudateLoop.reverse() extrudateLoops.append( extrudateLoop ) return extrudateLoops