Jump to content

Nicholl–Lee–Nicholl algorithm

From Wikipedia, the free encyclopedia
(Redirected from Nicholl-Lee-Nicholl)

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

Description

[edit]

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

See also

[edit]

Algorithms used for the same purpose:

References

[edit]
  • Tina M. Nicholl; D. T. Lee; Robin A. Nicholl (1987). "An efficient new algorithm for 2-D line clipping: Its development and analysis". Proceedings of the 14th annual conference on Computer graphics and interactive techniques - SIGGRAPH '87. pp. 253–262. doi:10.1145/37401.37432. ISBN 0897912276. S2CID 32296395.