Eulerian approximate ray tracing and applications to grid generation