Jump to content

Boolean operations on polygons: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
GreenC bot (talk | contribs)
 
(17 intermediate revisions by 14 users not shown)
Line 1: Line 1:
'''Boolean operations on polygons''' are a set of [[Boolean algebra|Boolean operation]]s (AND, OR, NOT, XOR, ...) operating on one or more sets of [[polygon]]s in computer graphics. These sets of operations are widely used in [[computer graphics]], [[CAD]], and in [[electronic design automation|EDA]] (in [[integrated circuit]] physical design and verification software).
'''Boolean operations on polygons''' are a set of [[Boolean operation (Boolean algebra)|Boolean operation]]s (AND, OR, NOT, XOR, ...) operating on one or more sets of [[polygon]]s in computer graphics. These sets of operations are widely used in [[computer graphics]], [[Computer-aided design|CAD]], and in [[electronic design automation|EDA]] (in [[integrated circuit]] physical design and verification software).
[[File:Boolean operations on shapes.png|thumbnail|right|Different boolean operations]]
[[File:Boolean operations on shapes-en.svg|thumbnail|right|Different boolean operations]]


== Algorithms ==
== Algorithms ==
Line 25: Line 25:
| title = Efficient hidden surface removal for objects with small union size
| title = Efficient hidden surface removal for objects with small union size
| volume = 2
| volume = 2
| year = 1992}}.</ref>
| year = 1992| doi-access = free
}}.</ref>


==See also==
==See also==
* [[Boolean algebra]]
* [[Computational geometry]]
* [[Constructive solid geometry]], a method of defining three-dimensional shapes using a similar set of operations
* [[Constructive solid geometry]], a method of defining three-dimensional shapes using a similar set of operations
* [[Geometry processing]]
* [[General Polygon Clipper]], a C library which computes the results of clipping operations


==Notes==
==Notes==
Line 35: Line 40:
== Bibliography ==
== Bibliography ==
{{refbegin}}
{{refbegin}}
* Mark de Berg, Marc van Kreveld, Mark Overmars, and Otfried Schwarzkopf, Computational Geometry - Algorithms and Applications, Second Edition, 2000
* Mark de Berg, Marc van Kreveld, [[Mark Overmars]], and Otfried Schwarzkopf, Computational Geometry - Algorithms and Applications, Second Edition, 2000
* Jon Louis Bentley and Thomas A. Ottmann, [http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?arnumber=1675432 Algorithms for Reporting and Counting Geometric Intersections], IEEE Transactions on Computers, Vol. C-28, No. 9, September 1979, pp.&nbsp;643–647
* Jon Louis Bentley and Thomas A. Ottmann, [https://ieeexplore.ieee.org/document/1675432/;jsessionid=C7C5DA2FF6075A109E90E53B7071A60E?arnumber=1675432 Algorithms for Reporting and Counting Geometric Intersections], IEEE Transactions on Computers, Vol. C-28, No. 9, September 1979, pp.&nbsp;643–647
* Jon Louis Bentley and Derick Wood, [http://ieeexplore.ieee.org/search/wrapper.jsp?arnumber=1675628 An Optimal Worst Case Algorithm for Reporting Intersections of Rectangles], IEEE Transactions on Computers, Vol. C-29. No. 7, July 1980, pp.&nbsp;571–577
* [[Jon Louis Bentley]] and [[Derick Wood]], [https://ieeexplore.ieee.org/search/wrapper.jsp?arnumber=1675628 An Optimal Worst Case Algorithm for Reporting Intersections of Rectangles], IEEE Transactions on Computers, Vol. C-29. No. 7, July 1980, pp.&nbsp;571–577
* Ulrich Lauther, [http://portal.acm.org/citation.cfm?id=802358&jmp=abstract An O(N log N) Algorithm for Boolean Mask Operations], 18th Design Automation Conference, 1981, pp.&nbsp;555–562
* Ulrich Lauther, [http://portal.acm.org/citation.cfm?id=802358&jmp=abstract An O(N log N) Algorithm for Boolean Mask Operations], 18th Design Automation Conference, 1981, pp.&nbsp;555–562
* James A. Wilmore, [http://portal.acm.org/citation.cfm?id=802360 Efficient Boolean Operations on IC Masks], 18th Design Automation Conference, 1981, pp.&nbsp;571–579
* James A. Wilmore, [http://portal.acm.org/citation.cfm?id=802360 Efficient Boolean Operations on IC Masks], 18th Design Automation Conference, 1981, pp.&nbsp;571–579
* {{cite journal | first = J. | last1 = Nievergelt | first2 = F. P. | last2 = Preparata | title = Plane-Sweep Algorithms for Intersecting Geometric Figures | id = {{citeseerx|10.1.1.83.3275}} | journal = Communications of the ACM |date=October 1982 | volume = 25 | issue = 10 | pages = 739–747 | doi=10.1145/358656.358681}}
* {{cite journal | first = J. | last1 = Nievergelt | first2 = F. P. | last2 = Preparata | title = Plane-Sweep Algorithms for Intersecting Geometric Figures | citeseerx = 10.1.1.83.3275 | journal = Communications of the ACM |date=October 1982 | volume = 25 | issue = 10 | pages = 739–747 | doi=10.1145/358656.358681| s2cid = 16606107 }}
* Thomas Ottmann, Peter Widmayer, and Derick Wood, "A Fast Algorithm for the Boolean Masking Problem," Computer Vision, Graphics, and Image Processing, 30, 1985, pp.&nbsp;249–268
* Thomas Ottmann, Peter Widmayer, and Derick Wood, "[https://www.sciencedirect.com/science/article/pii/0734189X85901598 A Fast Algorithm for the Boolean Masking Problem]," Computer Vision, Graphics, and Image Processing, 30, 1985, pp.&nbsp;249–268


{{refend}}
{{refend}}

==See also==
* [[Boolean algebra]]
* [[Computational geometry]]
* [[Constructive solid geometry]]
* [[General Polygon Clipper]], a C library which computes the results of clipping operations


==External links==
==External links==
* [http://compgeom.cs.uiuc.edu/~jeffe/compgeom/ UIUC Computational Geometry Pages]
* [https://web.archive.org/web/20111106212300/http://compgeom.cs.uiuc.edu/~jeffe/compgeom/ UIUC Computational Geometry Pages]
* [http://compgeom.cs.uiuc.edu/~jeffe/compgeom/code.html Constructive planar geometry], by Dave Eberly.
* [https://web.archive.org/web/20081219103233/http://compgeom.cs.uiuc.edu/~jeffe/compgeom/code.html Constructive planar geometry], by Dave Eberly.


;Software
;Software
* Michael Leonov has compiled a [http://www.complex-a5.ru/polyboolean/comp.html comparison of polygon clippers].
* Michael Leonov has compiled a [https://web.archive.org/web/20110720075903/http://www.complex-a5.ru/polyboolean/comp.html comparison of polygon clippers].
* Angus Johnson has also [http://angusj.com/delphi/clipper.php#features compared three clipping libraries].
* Angus Johnson has also [http://angusj.com/delphi/clipper.php#features compared three clipping libraries].
* SINED GmbH has [http://www.ulybin.de/products/polygonlib.php?lang=en#comparison compared performance and memory utilization of three polygon clippers].
* SINED GmbH has [http://www.ulybin.de/products/polygonlib.php?lang=en#comparison compared performance and memory utilization of three polygon clippers] {{Webarchive|url=https://web.archive.org/web/20121116204221/http://www.ulybin.de/products/polygonlib.php?lang=en#comparison |date=2012-11-16 }}.
* A comparison of 5 clipping libraries at [http://rogue-modron.blogspot.com/2011/04/polygon-clipping-wrapper-benchmark.html rogue-modron.blogspot.com]
* A comparison of 5 clipping libraries at [http://rogue-modron.blogspot.com/2011/04/polygon-clipping-wrapper-benchmark.html rogue-modron.blogspot.com]
* A commercial library for 3D Boolean operations: [http://www.geometros.com sgCore C++/C# library].
* A commercial library for 3D Boolean operations: [http://www.geometros.com sgCore C++/C# library].
Line 64: Line 63:
* Matthias Kramm's [http://gfxpoly.quiss.org/ gfxpoly], a free C library for 2D polygons (BSD license).
* Matthias Kramm's [http://gfxpoly.quiss.org/ gfxpoly], a free C library for 2D polygons (BSD license).
* Klaas Holwerda's [http://boolean.klaasholwerda.nl/bool.html Boolean], a C++ library for 2D polygons.
* Klaas Holwerda's [http://boolean.klaasholwerda.nl/bool.html Boolean], a C++ library for 2D polygons.
* David Kennison's [http://www.dkrz.de/ngdoc/ng/supplements/polypack/ Polypack], a FORTRAN library based on the Vatti algorithm.
* David Kennison's [https://web.archive.org/web/20081103090937/http://www.dkrz.de/ngdoc/ng/supplements/polypack/ Polypack], a FORTRAN library based on the Vatti algorithm.
* Klamer Schutte's [http://clippoly.sourceforge.net/ Clippoly], a polygon clipper written in C++.
* Klamer Schutte's [http://clippoly.sourceforge.net/ Clippoly], a polygon clipper written in C++.
* Michael Leonov's [http://www.complex-a5.ru/polyboolean/comp.html poly_Boolean], a C++ library, which extends the Schutte algorithm.
* Michael Leonov's [https://web.archive.org/web/20110720075903/http://www.complex-a5.ru/polyboolean/comp.html poly_Boolean], a C++ library, which extends the Schutte algorithm.
* Angus Johnson's [http://sourceforge.net/projects/polyclipping/ Clipper], an open-source freeware library (written in Delphi, C++ and C#) that's based on the [[Vatti clipping algorithm|Vatti algorithm]].
* Angus Johnson's [http://sourceforge.net/projects/polyclipping/ Clipper], an open-source freeware library (written in Delphi, C++ and C#) that's based on the [[Vatti clipping algorithm|Vatti algorithm]].
* [https://crates.io/crates/clipper2 clipper2 crate], a safe Rust wrapper for Angus Johnson's Clipper2 library.
* [http://www.geolib.co.uk/index.htm GeoLib], a commercial library available in C++ and C#.
* [http://www.geolib.co.uk/index.htm GeoLib], a commercial library available in C++ and C#.
* Alan Murta's [http://www.cs.man.ac.uk/~toby/alan/software/ GPC], General Polygon Clipper library.
* Alan Murta's [http://www.cs.man.ac.uk/~toby/alan/software/ GPC] {{Webarchive|url=https://web.archive.org/web/20110227070056/http://www.cs.man.ac.uk/~toby/alan/software/ |date=2011-02-27 }}, General Polygon Clipper library.
* [http://www.ulybin.de/products/polygonlib.php?lang=en PolygonLib], C++ and COM libraries for 2D polygons (optimized for large polygon sets, built-in spatial indices).
* [http://www.ulybin.de/products/polygonlib.php?lang=en PolygonLib] {{Webarchive|url=https://web.archive.org/web/20121116204221/http://www.ulybin.de/products/polygonlib.php?lang=en |date=2012-11-16 }}, C++ and COM libraries for 2D polygons (optimized for large polygon sets, built-in spatial indices).


[[Category:Geometric algorithms]]
[[Category:Geometric algorithms]]
[[Category:Geometry processing]]

Latest revision as of 03:13, 31 July 2024

Boolean operations on polygons are a set of Boolean operations (AND, OR, NOT, XOR, ...) operating on one or more sets of polygons in computer graphics. These sets of operations are widely used in computer graphics, CAD, and in EDA (in integrated circuit physical design and verification software).

Different boolean operations

Algorithms

[edit]

Uses in software

[edit]

Early algorithms for Boolean operations on polygons were based on the use of bitmaps. Using bitmaps in modeling polygon shapes has many drawbacks. One of the drawbacks is that the memory usage can be very large, since the resolution of polygons is proportional to the number of bits used to represent polygons. The higher the resolution is desired, the more the number of bits is required.

Modern implementations for Boolean operations on polygons tend to use plane sweep algorithms (or Sweep line algorithms). A list of papers using plane sweep algorithms for Boolean operations on polygons can be found in References below.

Boolean operations on convex polygons and monotone polygons of the same direction may be performed in linear time.[1]

See also

[edit]

Notes

[edit]
  1. ^ Katz, Matthew J.; Overmars, Mark H.; Sharir, Micha (1992), "Efficient hidden surface removal for objects with small union size", Computational Geometry: Theory and Applications, 2 (4): 223–234, doi:10.1016/0925-7721(92)90024-M.

Bibliography

[edit]
[edit]
Software