def getEmptyZ(shape, z):
 zoneIndex = round((z / shape.zoneInterval))
 if (zoneIndex not in shape.zZoneTable):
  return z
 zoneAround = 1
 while 1:
  zoneDown = (zoneIndex - zoneAround)
  if (zoneDown not in shape.zZoneTable):
   return (zoneDown * shape.zoneInterval)
  zoneUp = (zoneIndex + zoneAround)
  if (zoneUp not in shape.zZoneTable):
   return (zoneUp * shape.zoneInterval)
  zoneAround += 1

def getEmptyZ ( shape , z ) : zoneIndex = round ( ( z / shape . zoneInterval ) ) if ( zoneIndex not in shape . zZoneTable ) : return z zoneAround = 1 while 1 : zoneDown = ( zoneIndex - zoneAround ) if ( zoneDown not in shape . zZoneTable ) : return ( zoneDown * shape . zoneInterval ) zoneUp = ( zoneIndex + zoneAround ) if ( zoneUp not in shape . zZoneTable ) : return ( zoneUp * shape . zoneInterval ) zoneAround += 1
get the first z which is not in the zone table .