摘要
直线裁剪是几何造型中的重要内容。提出一种通过二重编码和坐标变换实现圆形窗口裁剪直线的算法。该算法首先通过二重编码快速舍弃大部分位于窗口外的直线段,然后通过坐标变换判断出剩余直线段与圆形窗口的相对位置,并求出其交点。应用实例表明,与其他算法相比,该算法简化了裁剪的逻辑判断过程,且将求交过程简化为加减法的运算,避免了求解二次方程,故大大提高了算法效率。
Line clipping is very important in geometry modelling. In this paper it gives a line clipping algorithm against circular window based on coordinate transformation and double-encoding. First, most of the lines outside of the window are fast rejected via double-encoding method. And then, the position relations among the window and the remaining lines can be found by coordinate transformation. Simultaneously, the intersection points are calculated as well. Application example shows that comparing with other algorithms, it simplifies the logical judgement process of clipping, and with the simplification of the intersection points' calculation to adding and subtraction operations, the given algo-rithm turns aside solving the quadratic equation which leads to great improvement of its efficiency.
出处
《计算机应用与软件》
CSCD
2009年第6期259-261,共3页
Computer Applications and Software
关键词
圆形窗口
直线裁剪
坐标变换
编码
Circular window Line clipping Coordinates transformation Encode