摘要
多边形裁剪与线剪裁相比具有更广泛的实用意义,因此它是目前裁剪研究的主要课题.提出了一个多边形裁剪多边形的有效算法.其中的多边形都可以是一般多边形,既可以是凹多边形,也可以是有内孔的多边形.该算法不仅可以求多边形的交(多边形裁剪),而且可以求多边形的并和差.它是以所提出的一系列新方法和新技术为基础而形成的.首先,该算法使用单线性链表数据结构,与其他使用双链表或树结构的算法相比,具有 占用空间少及处理速度快的特点;其次,找到了两个多边形之间进、出点之间的关系.再通过合理的数据结构处理,减少了算法对多边形链表的遍历次数,而且允许多边形既可以按顺时针方向也可以按逆时针方向输入.最后,判断和计算交点是裁剪算法的主要工作.提出了一个具有最少计算量的交点判断和计算方法,进一步加快了算法的运行速度.与其他同类算法进行了比较,结果表明,新算法具有最简单的结构和最快的执行速度.
Polygon clipping is more often used than line clipping in practice, so it is the main subject in clipping research now. An efficient algorithm for polygon clipping which processes general polygons including concave polygons and polygons with holes inside is presented in this paper. This algorithm can be used to calculate not only intersection (clipping) but also set-theoretic differences and union of two polygons. It is based on some new techniques proposed in this paper. Firstly, singly linked lists are used as the data structure of this algorithm rather than doubly linked lists or trees as other algorithms use, so less memory space and running time are required. Secondly, the relationship between the entry and exit points on the two polygons is found, which, with the reasonable operations on the lists, reduces the times that the lists are traversed and allows the polygon to be input clockwise or counterclockwise. Lastly, finding and computing of intersection points is a main procedure. An efficient technique for finding and computing intersection points is presented, which makes the speed of the algorithm higher. At the end of this paper, the new algorithm is compared with the existing algorithms and the result shows that it uses less memory space and has higher speed than others.
出处
《软件学报》
EI
CSCD
北大核心
2003年第4期845-856,共12页
Journal of Software
基金
国家民委科技基金
辽宁省科技基金~~
关键词
多边形裁剪算法
计算机图形学
凹多边形
数据结构
图形处理
computer graphics
concave polygons
polygon clipping
intersection calculation
singly linked list