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

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