Much better STL slicing algorithm