Description
Clipping is defined as the interaction of subject and clip polygons. While clipping usually involves finding the intersections (regions of overlap) of subject and clip polygons, clipping algorithms can also be applied with other boolean clipping operations: difference, where the clipping polygons ''remove'' overlapping regions from the subject; union, where clipping returns the regions covered by either subject or clip polygons, and; xor, where clipping returns the regions covered by either subject or clip polygons ''except'' where they are covered by both subject and clip polygons. The Vatti algorithm involves processing both subject and clipping polygon edges in an orderly fashion, starting with the lowermost edges and working towards the top; this is conceptually similar to the Bentley–Ottmann algorithm. This sweep line approach divides the problem space by ''scanlines'', imaginary horizontal lines that pass through every vertex of the participating polygons. These ''scanlines'' outline ''scanbeams'' – the spaces between adjacent scanlines. These scanbeams are processed in turn, starting with the lowest scanbeam, with the algorithm adding points of intersection within these scanbeams into the solution polygons.See also
* Martinez-Rueda_clipping_algorithm * Greiner–Hormann clipping algorithm * Sutherland–Hodgman clipping algorithm * Weiler–Atherton clipping algorithm *References
External links