针对现有的大多数计算几何形状间最短距离的算法都需要进行大量的多边形检测,且有时计算出的最短距离不够精确的问题,提出一种计算NURBS曲线与曲线、曲线与曲面和曲面与曲面间最短距离的算法.首先将2个NURBS形状分解成分段B啨zier表示的2个集合,给出一种计算2个集合的边界包围球的简单快速算法;然后分别在2个集合中选择包含最短距离的B啨zier表示对形成候选集.该算法采用边界包围球和"四点条件"约束提高计算效率,用多维Newton-Raphson迭代计算所有候选对间的局部最短距离,由此求出全局的最短距离.实验结果表明,文中算法具有速度快、精度高和鲁棒性好的特点,可实时计算2个NURBS曲线曲面间的最短距离.
The disadvantage of the most existing algorithms for computing the shortest distance between geometric objects is that it needs to do a lot of polygon detections, and the shortest distance computed is not precise enough sometimes. In this paper, a method is proposed to compute the minimum distance between NURBS objects (curve-curve, curve-surface and surface-surface). It firstly decompose both of the NURBS objects into their piecewise Bézier forms to form two sets, and the bounding spheres of each Bézier object are computed. Then, candidate pairs are extracted from the two sets based on a two-level selection process. The property of the new method is that the upper-lower bounds and ‘four-points-condition’ are used to chose the candidate pairs, which makes the candidate pairs as few as possible, and hence, the computation costs could be reduced greatly. At last, an iterative multidimensional Newton-Raphson method is applied to all candidate pairs in order to calculate the approximate local minimum distances. By comparing all local minimum distances between a pair of Bézier objects, we are able to find the global minimum distance. The experiments show the new method is a high-performance, accurate and robust. It can process two NURBS objects in real-time under the condition of machine accuracy.