现代计算机(普及版)
現代計算機(普及版)
현대계산궤(보급판)
MODERN COMPUTER
2014年
9期
51-53,57
,共4页
裁剪%线段%交点特征%区域编码
裁剪%線段%交點特徵%區域編碼
재전%선단%교점특정%구역편마
Clipping%Straight-Line Segment%Intersection Features%Region Code
由Weiler-Atherton和Cohen-Sutherland算法思想,提出一种基于交点和区域特征的线段裁剪算法。算法将矩形窗口按水平方向和竖直方向各划分成三个区域,并从线段的有向性出发,根据起点和终点的不同给出-1、0和1的编码值,从而简化了“弃之”情况的判断。在求交中,为了避免直线段与裁剪边的多次求交,充分利用直线段“入点”和“出点”的唯一性和成对存在的性质,使得该算法具有较强的稳定性和较高的裁剪效率。
由Weiler-Atherton和Cohen-Sutherland算法思想,提齣一種基于交點和區域特徵的線段裁剪算法。算法將矩形窗口按水平方嚮和豎直方嚮各劃分成三箇區域,併從線段的有嚮性齣髮,根據起點和終點的不同給齣-1、0和1的編碼值,從而簡化瞭“棄之”情況的判斷。在求交中,為瞭避免直線段與裁剪邊的多次求交,充分利用直線段“入點”和“齣點”的唯一性和成對存在的性質,使得該算法具有較彊的穩定性和較高的裁剪效率。
유Weiler-Atherton화Cohen-Sutherland산법사상,제출일충기우교점화구역특정적선단재전산법。산법장구형창구안수평방향화수직방향각화분성삼개구역,병종선단적유향성출발,근거기점화종점적불동급출-1、0화1적편마치,종이간화료“기지”정황적판단。재구교중,위료피면직선단여재전변적다차구교,충분이용직선단“입점”화“출점”적유일성화성대존재적성질,사득해산법구유교강적은정성화교고적재전효솔。
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.