def getInclusiveLoops( allPoints, corners, importRadius, isInteriorWanted ): "Get loops which include most of the points." circleNodes = intercircle.getCircleNodesFromPoints( allPoints, importRadius ) centers = intercircle.getCentersFromCircleNodes( circleNodes ) loops = intercircle.getLoopsFromLoopsDirection( True, centers ) pointTable = {} for loop in loops: addLoopToPointTable( loop, pointTable ) if not isInteriorWanted: return getLoopsWithCorners( corners, importRadius, loops, pointTable ) clockwiseLoops = getLoopsInDescendingOrderOfArea( intercircle.getLoopsFromLoopsDirection( False, centers ) ) clockwiseLoops.reverse() for clockwiseLoop in clockwiseLoops: if len( clockwiseLoop ) > 2 and euclidean.getMaximumSpan( clockwiseLoop ) > 2.5 * importRadius: if getOverlapRatio( clockwiseLoop, pointTable ) < 0.45: loops.append( clockwiseLoop ) addLoopToPointTable( clockwiseLoop, pointTable ) return getLoopsWithCorners( corners, importRadius, loops, pointTable )
def isLarge( loop, requiredSize ): "Determine if the loop is as large as the required size." return euclidean.getMaximumSpan( loop ) > abs( requiredSize )
def isLargeSameDirection( inset, loop, radius ): "Determine if the inset is in the same direction as the loop and it is large enough." if euclidean.isWiddershins( inset ) != euclidean.isWiddershins( loop ): return False return euclidean.getMaximumSpan( inset ) > 2.01 * abs( radius )
def isLargeSameDirection(inset, loop, radius): "Determine if the inset is in the same direction as the loop and it is large enough." if euclidean.isWiddershins(inset) != euclidean.isWiddershins(loop): return False return euclidean.getMaximumSpan(inset) > 2.01 * abs(radius)