def getJoinOfXIntersectionIndexes(xIntersectionIndexList):
 xIntersections = []
 solidTable = {}
 solid = False
 xIntersectionIndexList.sort()
 for xIntersectionIndex in xIntersectionIndexList:
  toggleHashtable(solidTable, xIntersectionIndex.index, '')
  oldSolid = solid
  solid = (len(solidTable) > 0)
  if (oldSolid != solid):
   xIntersections.append(xIntersectionIndex.x)
 return xIntersections

def getJoinOfXIntersectionIndexes ( xIntersectionIndexList ) : xIntersections = [ ] solidTable = { } solid = False xIntersectionIndexList . sort ( ) for xIntersectionIndex in xIntersectionIndexList : toggleHashtable ( solidTable , xIntersectionIndex . index , '' ) oldSolid = solid solid = ( len ( solidTable ) > 0 ) if ( oldSolid != solid ) : xIntersections . append ( xIntersectionIndex . x ) return xIntersections
get joined x intersections from surrounding layers .