Cohen-Sutherland线段裁减的改进算法 陈玉进 李泉 南京跬步科技有限公司 http://www.creable.cn 摘要:Cohen-Sutherland线段裁减算法,对于线段全部落入视口内、或线段位于视口外一侧的情况判断较容易,而除此之外的情况判断裁减较复杂,需要线段与视口边线作多次求交裁减,减少求交裁减的次数是提高算法效率的关键。本文提出一种新的改进算法,先对编码进行“逻辑与”操作排除掉线段位于视口外一侧的情况,再对编码进行“逻辑或”操作,并对其结果分类讨论,以确定不同的相交情形,有效地减少了线段求交裁减次数,提高了算法的效率。 关键词:Cohen-Sutherland线段裁减算法,逻辑与,逻辑或 中图分类号:TP391 Improvement to Cohen-Sutherland Line Clipping Algorithm Abstract:Cohen-Sutherland Line Clipping Algorithm can easily deal with the case that the line is completely inside of the view, or off to the side of the view, and other cases are complexly dealt with operations between line and view several times .The key of improving the algorithm is reducing the times of the Intersecting and Clipping operations. The paper proposed a new improved algorithm. Firstly, the logical AND operation of the codes eliminates the case that the line is completely inside of the view. Then, the logical OR operation of the codes determines the location relationship between line and view. This way could reduce algorithm complexity effectively. Key words:Cohen-Sutherland Line Clipping Algorithm,logical AND,logical OR
线段裁减算法,是保留视口范围内的图形部分,裁减掉超出视口范围的图形,很多复杂图形的裁减也都可以归为线段裁减,因此,线段裁减是图形显示的重要环节,算法的效率直接影响图形显示的效果。在计算机图形学中,比较常用的算法有:Cohen-Sutherland编码裁减算法、梁友栋-Barsky算法等。本文对Cohen-Sutherland编码裁减算法提出了一些改进的思路。 1. Cohen-Sutherland算法概述 1.1 Cohen |
GIS开窗裁减(Cohen-Sutherland线段裁减的改进算法)
最新推荐文章于 2020-09-15 02:21:44 发布
本文介绍了GIS领域中对Cohen-Sutherland线段裁减算法的改进,探讨了如何更有效地进行图形开窗裁减操作,涉及线段与窗口边界交点的判断及裁减过程。
摘要由CSDN通过智能技术生成