P2M: A Fast Solver for Querying Distance from Point to Mesh Surface

Chen Zong, Jiacheng Xu, Jiantao Song, Shuang-Min Chen, Shiqing Xin, Wenping Wang, Changhe Tu · DOI

Abstract

Point-to-mesh distance queries are fundamental operations in computer graphics and physical simulations. While Bounding Volume Hierarchies (BVH) have been the industry standard for decades, they face performance plateaus and sensitivity to mesh quality. This paper introduces P2M, a novel algorithmic paradigm that replaces traditional BVH with a KD-tree of mesh vertices coupled with a precomputed "interception table." By shifting computational complexity to an offline preprocessing phase, P2M achieves query speeds 2x to 10x faster than state-of-the-art solvers like FCPW and PQP, while maintaining high robustness against "dirty" geometry.

The Performance Plateau of BVH

Calculating the shortest distance between a point in space and a complex 3D mesh is a critical operation in CAD, physical simulations, and rendering. Traditionally, solvers rely on Bounding Volume Hierarchies (BVH) to wrap triangles in nested boxes (AABBs or OBBs), allowing them to prune large groups of distant primitives. However, BVH performance is highly dependent on mesh quality; "skinny" triangles or "triangle soup" (meshes with gaps or self-intersections) can significantly degrade search efficiency. P2M addresses these limitations by moving away from spatial primitive hierarchies toward a vertex-centric approach.

P2M utilizes a vertex-based KD-tree to quickly identify the local neighborhood of a query point on a complex mesh.

Methodology: The Interception Table

The core innovation of P2M is the Interception Table, which facilitates a two-stage process designed to minimize online query time.

1. Preprocessing

  • KD-tree (KDT) Construction: A KDT is built using only the mesh vertices, providing a fast initial lookup mechanism.
  • Interception Inspection: The algorithm identifies cases where the nearest vertex to a query point is not part of the nearest primitive (edge or face). In such instances, the vertex is said to "intercept" that primitive.
  • Flooding Algorithm: To efficiently map these relationships, P2M uses a flooding algorithm that traverses the Voronoi cells of the mesh. This avoids the prohibitive cost of checking every vertex against every primitive.
  • Local Optimization: For vertices that intercept a large number of primitives, those primitives are organized into a local R-tree to ensure the final query remains fast.
The interception table (d) is constructed by analyzing the intersection of Voronoi cells (a-c), mapping vertices to the specific primitives they intercept.

2. Querying

When a query point $q$ is provided, the system first identifies the nearest vertex $v$ via the KDT. It then retrieves the associated list of intercepted primitives from the precomputed table. Because the KDT search is extremely efficient and interception lists are typically short, the overall query time is significantly reduced compared to traditional tree-traversal methods.

Experimental Evaluation

The authors benchmarked P2M against industry standards including PQP, Embree, and FCPW using several datasets:

  • High-Resolution Models: Models like the Armadillo (100k faces) and Dragon (up to 1.5M faces) were used to test scalability.
  • Thingi10K: A dataset of 10,000 diverse 3D-printing models provided a rigorous test for robustness against topological errors and varied geometries.
  • Stress Tests: "Triangle soup" versions of models with high self-penetration were used to evaluate performance on low-quality geometry.

Key Results

  • Superior Speed: On a 1.5-million-face Dragon model, P2M outperformed PQP by 4x and FCPW by 2x. Across the Thingi10K dataset, speedups reached up to 10x.
  • Scalability: Query costs for P2M scale gracefully with mesh resolution, maintaining a consistent lead even as model complexity increases.
  • Robustness: Unlike BVH-based methods, P2M's reliance on vertex distribution makes it largely immune to the performance degradation typically caused by poor triangulation.

Discussion and Limitations

P2M represents a significant paradigm shift, trading offline computation time and memory for online performance. While a BVH might build in seconds, P2M’s preprocessing can take minutes, and its memory footprint is substantially larger (e.g., 1.78 GB for a Dragon model vs. 0.16 GB for FCPW). Furthermore, highly symmetrical shapes like perfect spheres can lead to longer interception lists, reducing efficiency. Currently, the solver is specialized for point-to-mesh distance and does not yet support broader features like ray-surface intersections or general collision detection.

Summary updated

BibTeX
@article{zong2023p,
  author = {Chen Zong and Jiacheng Xu and Jiantao Song and Shuang-Min Chen and Shiqing Xin and Wenping Wang and Changhe Tu},
  title = {{P2M: A Fast Solver for Querying Distance from Point to Mesh Surface}},
  journal = {ACM Trans. Graphics},
  year = {2023},
  doi = {10.1145/3592439},
}
Figure