def getTransferClosestNestedRing(extrusionHalfWidth, nestedRings, oldOrderedLocation, skein, threadSequence):
 if (len(nestedRings) > 0):
  oldOrderedLocation.z = nestedRings[0].z
 closestDistance = 9.876543219876543e+17
 closestNestedRing = None
 for remainingNestedRing in nestedRings:
  distance = getClosestDistanceIndexToLine(oldOrderedLocation.dropAxis(), remainingNestedRing.boundary).distance
  if (distance < closestDistance):
   closestDistance = distance
   closestNestedRing = remainingNestedRing
 nestedRings.remove(closestNestedRing)
 closestNestedRing.addToThreads(extrusionHalfWidth, oldOrderedLocation, skein, threadSequence)
 return closestNestedRing

def getTransferClosestNestedRing ( extrusionHalfWidth , nestedRings , oldOrderedLocation , skein , threadSequence ) : if ( len ( nestedRings ) > 0 ) : oldOrderedLocation . z = nestedRings [ 0 ] . z closestDistance = 9.876543219876543e+17 closestNestedRing = None for remainingNestedRing in nestedRings : distance = getClosestDistanceIndexToLine ( oldOrderedLocation . dropAxis ( ) , remainingNestedRing . boundary ) . distance if ( distance < closestDistance ) : closestDistance = distance closestNestedRing = remainingNestedRing nestedRings . remove ( closestNestedRing ) closestNestedRing . addToThreads ( extrusionHalfWidth , oldOrderedLocation , skein , threadSequence ) return closestNestedRing
get and transfer the closest remaining nested ring .