Please wait a minute...
Journal of Zhejiang University-SCIENCE A (Applied Physics & Engineering)  2005, Vol. 6 Issue (Supplement 1): 100-107    DOI: 10.1007/BF02887224
Computer and Information Science     
Line clipping against polygonal window algorithm based on the multiple virtual boxes rejecting
WANG Jin, LU Guo-dong, PENG Qun-sheng, WU Xuan-hui
Download:     PDF (0 KB)     
Export: BibTeX | EndNote (RIS)      

Abstract  This paper presents a new algorithm for line clipping against a polygonal window by exploiting the local relationship between each line segment and the polygon. Firstly, a minimal enclosing box (MEB) of the polygon is adopted to reject the invisible line segments located outside the MEB. Secondly, a 45° rotated box is used to encode the endpoint of the line segment, and then reject a portion of the invisible segments crossing polygon corners. Finally, instead of encoding the endpoints of all line segments with respect to the polygonal window, each vertex of the polygon is encoded, taking the line segment to be clipped as reference. For efficient encoding of the polygon vertices, a new concept, termed with slope adaptive virtual box, is introduced regarding each line segment. Such a box can not only conveniently reject all totally invisible lines lying outside the MEB conveniently, but also precisely identify the edges of the polygon with which the line segment potentially intersects. With the summation of the vertex codes, it can be verified whether the line segment is separated from or potentially intersects the polygon window. Based on the product of the codes of adjacent vertices, singular cases of intersection can be solved accurately. Experimental results demonstrate the efficiency and stability of the new algorithm.

Key wordsPolygon vertex encoding      Adaptive virtual box      Line segment rejection      Line segment intersection      Line clipping     
CLC:  TP312  
Cite this article:

WANG Jin, LU Guo-dong, PENG Qun-sheng, WU Xuan-hui. Line clipping against polygonal window algorithm based on the multiple virtual boxes rejecting. Journal of Zhejiang University-SCIENCE A (Applied Physics & Engineering), 2005, 6(Supplement 1): 100-107.

URL:

http://www.zjujournals.com/xueshu/zjus-a/10.1007/BF02887224     OR     http://www.zjujournals.com/xueshu/zjus-a/Y2005/V6/ISupplement 1/100

[1] Bao-jun ZHANG, Xue-zeng PAN, Jie-bing WANG, Ling-di PING. A recoverable stress testing algorithm for compression and encryption cards[J]. Journal of Zhejiang University-SCIENCE A (Applied Physics & Engineering), 2008, 9(10): 1398-1405.
[2] WANG Jin, LU Guo-dong, PENG Qun-sheng, WU Xuan-hui. Line clipping against polygonal window algorithm based on the multiple virtual boxes rejecting[J]. Journal of Zhejiang University-SCIENCE A (Applied Physics & Engineering), 0, 6(100): 100-107.