def subtractXIntersectionsTable(subtractFromTable, subtractTable):
 subtractFromTableKeys = subtractFromTable.keys()
 subtractFromTableKeys.sort()
 for subtractFromTableKey in subtractFromTableKeys:
  xIntersectionIndexList = []
  addXIntersectionIndexesFromXIntersections((-1), xIntersectionIndexList, subtractFromTable[subtractFromTableKey])
  if (subtractFromTableKey in subtractTable):
   addXIntersectionIndexesFromXIntersections(0, xIntersectionIndexList, subtractTable[subtractFromTableKey])
  xIntersections = getXIntersectionsFromIntersections(xIntersectionIndexList)
  if (len(xIntersections) > 0):
   subtractFromTable[subtractFromTableKey] = xIntersections
  else:
   del subtractFromTable[subtractFromTableKey]

def subtractXIntersectionsTable ( subtractFromTable , subtractTable ) : subtractFromTableKeys = subtractFromTable . keys ( ) subtractFromTableKeys . sort ( ) for subtractFromTableKey in subtractFromTableKeys : xIntersectionIndexList = [ ] addXIntersectionIndexesFromXIntersections ( ( - 1 ) , xIntersectionIndexList , subtractFromTable [ subtractFromTableKey ] ) if ( subtractFromTableKey in subtractTable ) : addXIntersectionIndexesFromXIntersections ( 0 , xIntersectionIndexList , subtractTable [ subtractFromTableKey ] ) xIntersections = getXIntersectionsFromIntersections ( xIntersectionIndexList ) if ( len ( xIntersections ) > 0 ) : subtractFromTable [ subtractFromTableKey ] = xIntersections else : del subtractFromTable [ subtractFromTableKey ]
subtract the subtracttable from the subtractfromtable .