首页 | 本学科首页   官方微博 | 高级检索  
     

基于交点和区域特征的线段裁剪算法
引用本文:陈定钰,;丁有和.基于交点和区域特征的线段裁剪算法[J].现代计算机,2014(9):51-53.
作者姓名:陈定钰  ;丁有和
作者单位:[1]美国工程技术联合公司南京代表处,南京210001; [2]南京师范大学能源与机械工程学院,南京210042
摘    要:由Weiler-Atherton和Cohen-Sutherland算法思想,提出一种基于交点和区域特征的线段裁剪算法。算法将矩形窗口按水平方向和竖直方向各划分成三个区域,并从线段的有向性出发,根据起点和终点的不同给出-1、0和1的编码值,从而简化了“弃之”情况的判断。在求交中,为了避免直线段与裁剪边的多次求交,充分利用直线段“入点”和“出点”的唯一性和成对存在的性质,使得该算法具有较强的稳定性和较高的裁剪效率。

关 键 词:裁剪  线段  交点特征  区域编码

A Segment Clipping Algorithm Based on the Intersection and Region Features
Affiliation:CHEN Ding-yu, DING You-he (1. Engineering Technology Associates, Inc. Nanjing Rep. Office, Nanjing 210001 ; 2. School of Energy and Mechanical Engineering, Nanjing Normal University, Nanjing 210042)
Abstract:Proposes a new algorithm of straight-line segment clipping against rectangular window based on the thought of Weiler-Atherton and Co-hen-Sutherland algorithm. In this algorithm, divides the rectangular window into three regions by the horizontal and vertical direction each other. To reserve the straight-line directionality, every line endpoint in a region code is assigned a different value of-1, 0 or 1, and it can easily determine the“whole out” situation by code operations. To reduce the number of intersection computed, it takes full advan-tage of the properties that the line segment has only “in” and “out” point and exist in pairs. As a result, the application proves that this algorithm has the strong stability and high clipping efficiency.
Keywords:Clipping  Straight-Line Segment  Intersection Features  Region Code
本文献已被 维普 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号