Nicholl–Lee–Nicholl algorithm

The Nicholl–Lee–Nicholl algorithm is a fast line clipping algorithm that reduces the chances of clipping a single line segment multiple times, as may happen in the Cohen–Sutherland algorithm.

Description

Using the Nicholl–Lee–Nicholl algorithm, the area around the clipping window is divided into a number of different areas, depending on the position of the initial point of the line to be clipped. This initial point should be in three predetermined areas; thus the line may have to be translated and/or rotated to bring it into the desired region. The line segment may then be re-translated and/or re-rotated to bring it to the original position. After that, straight line segments are drawn from the line end point, passing through the corners of the clipping window. These areas are then designated as L, LT, LB, or TR, depending on the location of the initial point. Then the other end point of the line is checked against these areas. If a line starts in the L area and finishes in the LT area then the algorithm concludes that the line should be clipped at xw (max). Thus the number of clipping points is reduced to one, compared to other algorithms that may require two or more clipping

gollark: I reserve the right to install SPUDNET-py on your computer if you do this.
gollark: I literally only created it a few minutes ago.
gollark: How did you find *that*?
gollark: What?
gollark: Oh yes, that.

See also

Algorithms used for the same purpose:

References

  • Tina M. Nicholl; D. T. Lee; Robin A. Nicholl (1987). "An efficient new algorithm for 2-D line clipping: Its development and analysis". SIGGRAPH '87: 253–262.


This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.