摘要
本文的裁剪策略是,巧妙地利用窗口与线段两种不同数学描述,将有效交点的判定、求交运算及包含性检验,归结为三个条件的判别。这三个条件形式简明,运算量小,整个裁剪过程,只有在存在有效交点时才做除法,把除法以及其它计算量减少到最低限度,从而大大提高了裁剪效率。经多次用不同类型的多边形窗口试验表明,该算法程序量少,运算速度快,不仅可以高效地裁剪,而且适用于几何图形并、交、差,立体消隐中有关多边形与线段的处理,还可以在工程CAD中利用零件图生成装配图。
In this paper, an algorithm for line clipping against an arbitrary polygon window is presented. By means of different mathematical representations of straight line and line segment, the process of clipping is reduced to the determination of three simple conditions. The idea of the algorithm is that in the entire process of clipping, determinations are prior to calculations of intersection point but the work of determination is not more than that of other algorithms, division operations are needed only when the line segment to be clipped crosses edges of window polygon, the edges of window polygon which do not cross the line segment to be clipped are quickly rejected. Thus, divisions and other calculations are reduced to minimum and the efficiency of line clipping against a polygon window is greatly improved.
关键词
计算机图形学
裁剪
多边形
窗口
clipping, polygon window, line segment processing, visibility test, generating assembly drawing.