def getInsetLoopsFromLoop(loop, radius, thresholdRatio=0.9):
 if (radius == 0.0):
  return [loop]
 isInset = (radius > 0)
 insetLoops = []
 isLoopWiddershins = euclidean.isWiddershins(loop)
 arounds = getAroundsFromLoop(loop, radius, thresholdRatio)
 for around in arounds:
  leftPoint = euclidean.getLeftPoint(around)
  shouldBeWithin = (isInset == isLoopWiddershins)
  if (euclidean.isPointInsideLoop(loop, leftPoint) == shouldBeWithin):
   if (isLoopWiddershins != euclidean.isWiddershins(around)):
    around.reverse()
   insetLoops.append(around)
 return insetLoops

def getInsetLoopsFromLoop ( loop , radius , thresholdRatio = 0.9 ) : if ( radius == 0.0 ) : return [ loop ] isInset = ( radius > 0 ) insetLoops = [ ] isLoopWiddershins = euclidean . isWiddershins ( loop ) arounds = getAroundsFromLoop ( loop , radius , thresholdRatio ) for around in arounds : leftPoint = euclidean . getLeftPoint ( around ) shouldBeWithin = ( isInset == isLoopWiddershins ) if ( euclidean . isPointInsideLoop ( loop , leftPoint ) == shouldBeWithin ) : if ( isLoopWiddershins != euclidean . isWiddershins ( around ) ) : around . reverse ( ) insetLoops . append ( around ) return insetLoops
get the inset loops .