def addToThreadsFromLoop(extrusionHalfWidth, gcodeType, loop, oldOrderedLocation, skein):
 loop = getLoopStartingClosest(extrusionHalfWidth, oldOrderedLocation.dropAxis(), loop)
 oldOrderedLocation.x = loop[0].real
 oldOrderedLocation.y = loop[0].imag
 gcodeTypeStart = gcodeType
 if isWiddershins(loop):
  skein.distanceFeedRate.addLine(('(<%s> outer )' % gcodeType))
 else:
  skein.distanceFeedRate.addLine(('(<%s> inner )' % gcodeType))
 skein.addGcodeFromThreadZ((loop + [loop[0]]), oldOrderedLocation.z)
 skein.distanceFeedRate.addLine(('(</%s>)' % gcodeType))

def addToThreadsFromLoop ( extrusionHalfWidth , gcodeType , loop , oldOrderedLocation , skein ) : loop = getLoopStartingClosest ( extrusionHalfWidth , oldOrderedLocation . dropAxis ( ) , loop ) oldOrderedLocation . x = loop [ 0 ] . real oldOrderedLocation . y = loop [ 0 ] . imag gcodeTypeStart = gcodeType if isWiddershins ( loop ) : skein . distanceFeedRate . addLine ( ( '(<%s> outer )' % gcodeType ) ) else : skein . distanceFeedRate . addLine ( ( '(<%s> inner )' % gcodeType ) ) skein . addGcodeFromThreadZ ( ( loop + [ loop [ 0 ] ] ) , oldOrderedLocation . z ) skein . distanceFeedRate . addLine ( ( '(</%s>)' % gcodeType ) )
add to threads from the last location from loop .