Generalized winding numbers provide a robust measure of point insidedness for 3D surfaces - whether open, self-intersecting, or non-manifold - and are central to numerous geometry processing tasks. However, existing methods trade off between accuracy and computational efficiency, limiting their use in interactive and large-scale applications. We introduce a new formulation and algorithm for computing generalized winding numbers that is both fast and accurate to arbitrary precision, applicable to meshes and parametric surfaces. Our approach expresses the winding number as the sum of two intuitive geometric quantities: the signed number of ray-surface intersections and a boundary integral over the surface's projection onto the unit sphere. This insight leads to an efficient discretization that avoids expensive surface integrals and spherical arrangements. For meshes, our method achieves average speedups of $22\times$ on a CPU compared to the fastest precise methods and $3\times$ compared to the fastest approximation method, while maintaining full precision. On a GPU, for moderately complex meshes we reach a throughput of $10^9$ queries per second, or $4K$ generalized winding number slices at 120 FPS ($13\times$ faster than a naive GPU method). For parametric surfaces, our method is on average $5.6\times$ faster than the state-of-the-art method, with the same precision. Our method naturally handles complex topologies and non-manifold inputs. We extensively validate its accuracy, robustness, and time performance. Our code is available at https://github.com/MartensCedric/antipodal.
翻译:广义环绕数为三维曲面(包括开曲面、自交曲面或非流形曲面)提供了点位于曲面内部的鲁棒度量,是众多几何处理任务的核心基础。然而,现有方法在精度与计算效率之间需权衡取舍,限制了其在交互式及大规模场景中的应用。我们提出一种可计算任意精度广义环绕数的新公式与算法,其既能实现快速计算,又可保持精确性,适用于网格曲面与参数曲面。该方法将环绕数表示为两个直观几何量之和:光线与曲面相交的有符号次数,以及曲面在单位球面上投影的边界积分。这一见解引发出高效的离散化方案,避免了昂贵的面积分与球面排列计算。对于网格曲面,与最快精确方法相比,我们的方法在CPU上实现平均22倍的加速,相较于最快近似方法也获得3倍加速,同时保持全精度。在GPU上,对于中等复杂度网格,查询吞吐量可达每秒10⁹次,即每秒120帧的4K分辨率广义环绕数切片(比朴素GPU方法快13倍)。对于参数曲面,我们的方法以同等精度平均比现有最优方法快5.6倍。该方法天然支持复杂拓扑与非流形输入。我们对其准确性、鲁棒性及时效性进行了全面验证。代码开源于https://github.com/MartensCedric/antipodal。