Convex Quadratic Distance Field Computation
Methods for computing distances from sources on discrete meshes commonly either compute geodesics directly on polyhedral surfaces or approximate the distance in a finite-element framework. Exact window-based polyhedral methods are highly accurate on clean manifold surfaces, but their unfolding construction does not extend to tetrahedral volumes and relies on manifold connectivity. Because their results are tied to the input polyhedron, geometric noise directly affects the computed distance field. Finite-element methods extend naturally to triangle surfaces and tetrahedral volumes, but state-of-the-art methods represent the distance field as a piecewise-linear (PL) function, limiting accuracy on coarse or poorly shaped meshes. We argue that the PL representation itself, rather than the algorithm built on top of it, limits the result. Geodesic distance exhibits cone-like behaviour at its source and is not piecewise linear even on flat domains. In contrast, the squared distance is exactly quadratic in such domains. Therefore, our Quadratic Distance Field method represents the squared distance using piecewise-quadratic (PQ) elements, reproducing flat squared distances exactly. We show that simply increasing the element order does not improve existing algorithms, and develop a convex formulation for the squared distance over PQ elements. The same formulation applies to both triangle surfaces and tetrahedral volumes, supports anisotropic metrics and nonmanifold connectivity, and remains robust under noise. Finally, we present an efficient solver based on the alternating direction method of multipliers and demonstrate its robustness and accuracy on a benchmark of thousands of real-world models.