基于矩阵表示的NURBS曲面逆值GPU并行求解算法
GPU Parallel Inverse Evaluation of NURBS Surfaces Based on Matrix Representation
-
摘要: NURBS曲面逆向求值是CAD几何内核中最基础的算子之一,即计算NURBS曲面上三维空间点对应的二维参数值.然而,当前求解算法计算效率不高、鲁棒性不强,严重制约了CAD软件处理大规模复杂CAD模型的性能.现有的GPU加速算法也往往仅对传统算法进行简单并行化,没有充分利用GPU共享显存等架构特性.为此,提出一种全GPU运行的并行求解算法.基于NURBS矩阵表示的GPU逆值求解算法通过矩阵表示代替传统的B-Spline基函数递归表示,适配GPU缓存机制,实现GPU缓存优化,解决数据公用、寄存器占用和缓存频繁申请与释放等问题,从而提高求解效率.同时,该算法采用多层次求解算法,以自适应曲面细分算法得到粗略解,再辅以Gauss-Newton迭代法得到精确解,提高处理复杂模型的效率和鲁棒性.采用多张简单曲面和复杂曲面进行测试,结果表明,该算法每毫秒最多可求解超过10 000个逆值点,相比于传统算法,将NURBS曲面逆向求值速度提高了至少2个数量级.Abstract: Inverse evaluation, which calculates the corresponding 2D parameters for a given 3D surface point, is one of the most fundamental operators in CAD modelers. Current methods are often found insufficient when processing big and complex CAD models, particularly suffering from the efficiency and robustness issues. To improve efficiency, GPUs are often used to accelerate the computations, but most existing methods simply run the serial version in parallel, paying little attention to problems like GPU cache management. This paper presents an alternative parallel inverse evaluation method that is fully GPU-based. It proposes to use the matrix representation scheme of NURBS surfaces instead of the traditional recursion-based scheme, and combines it with the surface subdivision method and the iterative Gauss-Newton iteration method to improve data sharing and increase efficiency. Tests are performed on a number of simple and complex surfaces, and the conducted experimental results show that this method can solve more than 10 000 inverse points per millisecond, which is at least two orders of magnitude faster than the traditional method for NURBS surface inversion.