Skip to main content

A Speculative Approach to Clipping Line Segments

  • Conference paper
Computational Science and Its Applications - ICCSA 2006 (ICCSA 2006)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 3980))

Included in the following conference series:

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Blinn, J.F.: A trip down the graphics pipeline: Line clipping. IEEE Computer Graphics & Applications 11(1), 98–105 (1991)

    Article  Google Scholar 

  2. Cyrus, M., Beck, J.: Generalised two- and three-dimensional clipping. Computers & Graphics 3(1), 23–38 (1978)

    Article  Google Scholar 

  3. Day, J.D.: A new two dimensional line clipping algorithm for small windows. Computer Graphics Forum 11(4), 241–245 (1992)

    Article  Google Scholar 

  4. 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)

    Google Scholar 

  5. 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)

    Chapter  Google Scholar 

  6. 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)

    Article  Google Scholar 

  7. Liang, Y.D., Barsky, B.A.: A new concept and method for line clipping. ACM Transactions on Graphics 3(1), 1–22 (1984)

    Article  MATH  Google Scholar 

  8. 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)

    Article  Google Scholar 

  9. Slater, M., Barsky, B.A.: 2D line and polygon clipping based on space subdivision. The Visual Computer 10(1), 407–422 (1994)

    Article  Google Scholar 

  10. Foley, J.D., van Dam, A., Feiner, S.K., Hughes, J.F.: Computer Graphics: Principles and Practice, 2nd edn. Addison-Wesley, Reading (1996)

    MATH  Google Scholar 

  11. Hearn, D., Baker, P.: Computer Graphics with OpenGL, 3rd edn. Prentice Hall, Englewood Cliffs (2004)

    Google Scholar 

  12. Skala, V.: An efficient algorithm for line clipping by convex polygon. Computers & Graphics 17(4), 417–421 (1993)

    Article  Google Scholar 

  13. Knuth, D.E.: Sorting and Searching. In: The Art of Computer Programming, vol. 3. Addison-Wesley, Reading (1973)

    Google Scholar 

  14. Alford, W.R., Granville, A., Pomerance, C.: On the difficulty of finding reliable witnesses. LNCS, vol. 877, pp. 1–16. Springer, Heidelberg (1995)

    Google Scholar 

  15. Rabin, M.O.: Probabilistic algorithms for testing primality. Journal of Number Theory 12, 128–138 (1980)

    Article  MATH  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics