Skip to main content
Log in

An efficient algorithm to clip a 2D-polygon against a rectangular clip window

  • Published:
Applied Mathematics-A Journal of Chinese Universities Aims and scope Submit manuscript

Abstract

Polygon clipping is of great importance in computer graphics. One of the popular algorithms to clip a polygon is Cohan—Sutherland Hodgeman algorithm which is based on line clipping. Cohan—Sutherland Hodgeman algorithm clips the polygon against the given rectangular clip window with the help of line clipping method. Cohan—Sutherland algorithm requires traversing the polygon in anti clockwise direction (positive orientation). In this work we propose an efficient polygon clipping algorithm against a rectangular clip window. Proposed algorithm uses parametric representation of polygon edges. Using the concept of point clipping, we can find required intersection points of edges of polygon with clip window boundaries. Well suited numerical illustrations are used to explain the proposed polygon clipping method. The proposed algorithm is computationally less expensive and comprehensive.

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

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. D Cohen. Incremental methods for computer graphics, PhD Thesis, University of Harvard, Massachusetts, 1969.

    Google Scholar 

  2. Y D Liang, B A Barsky. An analysis and algorithms for polygon clipping, CACM 26, 1983: 868–876.

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

    Article  Google Scholar 

  4. M Cyrus, J Beck. Generalized two and three-dimensional clipping, Computers and Graphics, 1978, 3(1): 23–28.

    Article  Google Scholar 

  5. M Rappaport. An efficient algorithm for line and polygon clipping, The Visual Computer, 1991, 7(1): 19–28.

    Article  Google Scholar 

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

    Article  Google Scholar 

  7. V Skala. O (lg N) line clipping algorithm in E2, Computers and Graphics, 1994, 18(4): 517–424.

    Article  Google Scholar 

  8. K R Wijeweera, S R Kodituwakku, M P Chamikara. A novel and efficient approach for line segment clipping against a convex polygon, Ruhuna Journal of Science, 2019, 10(2): 161–173.

    Article  Google Scholar 

  9. K Schutte. An edge labelling approach to concave polygon clipping, ACM Transactions on Graphics, 1995: 1–10.

  10. E L Foster, K Hormann, R T Popa. Clipping simple polygons with degenerate intersections, Computers and Graphics, 2019, X(2).

  11. G Greiner, K Hormann. Efficient clipping of arbitrary polygons, ACM Transactions on Graphics, 1998, 17(2): 71–83.

    Article  Google Scholar 

  12. D H Kim, M J Kim. An extension of polygon clipping to resolve degenerate cases, Computer Aided Design Appl., 2006, 3: 447–456.

    Article  Google Scholar 

  13. Y K Liu, X Q Wang, S Z Bao, M GomboŠi, B Žalik. An algorithm for polygon clipping, and for determining polygon intersections and unions, Computers and Geosciences, 2007, 33: 589–598.

    Article  Google Scholar 

  14. S P Raja. Line and Polygon Clipping Techniques on Natural Images: A Mathematical Solution and Performance Evaluation, International Journal of Image and Graphics, 2019, 19(2).

  15. T M Nicholl, T Lee, R A Nicholl. An efficient new algorithm for 2D line clipping: Its development and analysis, in Proc SIGGRAPH’ 87, Comput Graph, 1987, 21(4): 253–262.

  16. E Mamatha, C Reddy, K Anand. An Efficient Line Clipping Algorithm in 2D Space, The International Arab Journal of Information Technology, 2019, 16(5).

  17. D Matthes, V Drakopoulos. Another Simple but Faster Method for 2D Line Clipping, International Journal of Computer Graphics and Animation, 2019, 9(1/2/3).

  18. S C Dimri. A Simple and Efficient Algorithm for Line and Polygon Clipping in 2-D Computer Graphics, International Journal of Computer Applications, 2015, 127(3).

  19. M Sharma, J Kaur. An Improved Polygon Clipping Algorithm Based on Affine Transformation, S C Satapathy, et al, in Proceedings of the Second International Conference on Computer and Communication Technologies, Advances in Intelligent Systems and Computing, 2016, 379.

  20. D Yang, S Chen, Q Yang, Y Hu. A Clipping Algorithm on Vector Graphics Based on Nonintersect Polygon Boundary, IEEE, 2019, 854–859.

  21. T Joshi, P Badoni, A Aggarwal. Modification of Weiler-Atherton Algorithm to Address Loose Polygons, Journal of Scientific and Industrial Research, 2019, 78: 771–774.

    Google Scholar 

  22. M Cao, H Zhang, C Zhou, Y Sun, H Yu. Vector Circle Clipping Algorithm Based on Polygon Window of Hexagonal Grid System, IOP Conf Series: Journal of Physics: Conf Series, 2019, 1288(012006).

  23. M Zhang, C L Sabharwal. An Efficient Implementation of Parametric Line And Polygon Clipping Algorithm, ACMSAC’02, 2002, 11–14.

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Umesh Kumar Tiwari.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Dimri, S.C., Tiwari, U.K. & Ram, M. An efficient algorithm to clip a 2D-polygon against a rectangular clip window. Appl. Math. J. Chin. Univ. 37, 147–158 (2022). https://doi.org/10.1007/s11766-022-4556-0

Download citation

  • Received:

  • Revised:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11766-022-4556-0

MR Subject Classification

Keywords

Navigation