Learning Smooth Distance Functions via Queries