def addXIntersectionIndexesFromLoopY(loop, solidIndex, xIntersectionIndexList, y):
 for pointIndex in xrange(len(loop)):
  pointFirst = loop[pointIndex]
  pointSecond = loop[((pointIndex + 1) % len(loop))]
  xIntersection = getXIntersectionIfExists(pointFirst, pointSecond, y)
  if (xIntersection != None):
   xIntersectionIndexList.append(XIntersectionIndex(solidIndex, xIntersection))

def addXIntersectionIndexesFromLoopY ( loop , solidIndex , xIntersectionIndexList , y ) : for pointIndex in xrange ( len ( loop ) ) : pointFirst = loop [ pointIndex ] pointSecond = loop [ ( ( pointIndex + 1 ) % len ( loop ) ) ] xIntersection = getXIntersectionIfExists ( pointFirst , pointSecond , y ) if ( xIntersection != None ) : xIntersectionIndexList . append ( XIntersectionIndex ( solidIndex , xIntersection ) )
add the x intersection indexes for a loop .