def isIntersectingItself(loop, width):
 outlines = []
 for pointIndex in xrange(len(loop)):
  pointBegin = loop[pointIndex]
  pointEnd = loop[((pointIndex + 1) % len(loop))]
  if euclidean.isLineIntersectingLoops(outlines, pointBegin, pointEnd):
   return True
  addSegmentOutline(False, outlines, pointBegin, pointEnd, width)
 return False

def isIntersectingItself ( loop , width ) : outlines = [ ] for pointIndex in xrange ( len ( loop ) ) : pointBegin = loop [ pointIndex ] pointEnd = loop [ ( ( pointIndex + 1 ) % len ( loop ) ) ] if euclidean . isLineIntersectingLoops ( outlines , pointBegin , pointEnd ) : return True addSegmentOutline ( False , outlines , pointBegin , pointEnd , width ) return False
determine if the loop is intersecting itself .