Abstract
The Nicholl-Lee-Nicholl (NLN) algorithm for clipping line segments against a rectangular window in the plane (Computer Graphics 21,4 pp 253–262) was proved to be optimal recently in terms of the minimum and maximum number of comparisons and the number of predicates used. A new algorithm is proposed that does not use predicates, but calculates intersections speculatively. Surprisingly, this approach not only leads to a much simpler algorithm, but also takes fewer operations in many cases, including the worst case. It is proved that the new algorithm never takes more operations than the optimal algorithm. Experimental results demonstrate that the new algorithm is 80% to 560% faster than long-established, widely known algorithms.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Blinn, J.F.: A trip down the graphics pipeline: Line clipping. IEEE Computer Graphics & Applications 11(1), 98–105 (1991)
Cyrus, M., Beck, J.: Generalised two- and three-dimensional clipping. Computers & Graphics 3(1), 23–38 (1978)
Day, J.D.: A new two dimensional line clipping algorithm for small windows. Computer Graphics Forum 11(4), 241–245 (1992)
Dévai, F.: An analysis technique and an algorithm for line clipping. In: Proc. 1998 IEEE Conference on Information Visualization, IV 1998, pp. 157–165 (1998)
Dévai, F.: Analysis of the Nicholl-Lee-Nicholl algorithm. In: Gervasi, O., Gavrilova, M.L., Kumar, V., Laganá, A., Lee, H.P., Mun, Y., Taniar, D., Tan, C.J.K. (eds.) ICCSA 2005. LNCS, vol. 3480, pp. 726–736. Springer, Heidelberg (2005)
Duvanenko, V.J., Gyurcsik, R.S., Robins, W.E.: Simple and efficient 2D and 3D span clipping algorithms. Computers & Graphics 17(1), 39–54 (1993)
Liang, Y.D., Barsky, B.A.: A new concept and method for line clipping. ACM Transactions on Graphics 3(1), 1–22 (1984)
Nicholl, T.M., Lee, D.T., Nicholl, R.A.: An efficient new algorithm for 2-D line clipping: its development and analysis. Comput. Graph. 21(4), 253–262 (1987)
Slater, M., Barsky, B.A.: 2D line and polygon clipping based on space subdivision. The Visual Computer 10(1), 407–422 (1994)
Foley, J.D., van Dam, A., Feiner, S.K., Hughes, J.F.: Computer Graphics: Principles and Practice, 2nd edn. Addison-Wesley, Reading (1996)
Hearn, D., Baker, P.: Computer Graphics with OpenGL, 3rd edn. Prentice Hall, Englewood Cliffs (2004)
Skala, V.: An efficient algorithm for line clipping by convex polygon. Computers & Graphics 17(4), 417–421 (1993)
Knuth, D.E.: Sorting and Searching. In: The Art of Computer Programming, vol. 3. Addison-Wesley, Reading (1973)
Alford, W.R., Granville, A., Pomerance, C.: On the difficulty of finding reliable witnesses. LNCS, vol. 877, pp. 1–16. Springer, Heidelberg (1995)
Rabin, M.O.: Probabilistic algorithms for testing primality. Journal of Number Theory 12, 128–138 (1980)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2006 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Dévai, F. (2006). A Speculative Approach to Clipping Line Segments. In: Gavrilova, M., et al. Computational Science and Its Applications - ICCSA 2006. ICCSA 2006. Lecture Notes in Computer Science, vol 3980. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11751540_15
Download citation
DOI: https://doi.org/10.1007/11751540_15
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-34070-6
Online ISBN: 978-3-540-34071-3
eBook Packages: Computer ScienceComputer Science (R0)