Skip to main content
Image links broken; now fixed.
Source Link
Joseph O'Rourke
  • 150.9k
  • 36
  • 358
  • 958

I suggest you investigate the CGAL manual, Chapter 19: "2D Regularized Boolean Set-Operations". Here is an example of polygon difference:
            PolygonSubtraction http://cs.smith.edu/%7Eorourke/MathOverflow/TriangleSubtraction.jpgPolygonSubtraction
This is well-understood & explored algorithmically, but nevertheless a very delicate computation, as the term regularized indicates. You are subtracting a rectangle, but there is nothing special about a rectangle—"degenerate" situations may occur. You really need to consider the general situation. So I recommend you look at general resources, such as

"Boolean operations on general planar polygons." M. Riveroa, F.R. Feitob. Computers & Graphics. Volume 24, Issue 6, December 2000, Pages 881–896 (Elsevier link)

or

"A General Polygon Clipping Library." Version 2.32. Alan Murta. (link)

The upperleft corner of Murta's Fig.2 illustrates a complicated polygon difference (and the remaining images illustrate other Boolean operations).
      Boolean Ops http://cs.smith.edu/%7Eorourke/MathOverflow/BooleanOps.jpgBoolean Ops

I suggest you investigate the CGAL manual, Chapter 19: "2D Regularized Boolean Set-Operations". Here is an example of polygon difference:
            PolygonSubtraction http://cs.smith.edu/%7Eorourke/MathOverflow/TriangleSubtraction.jpg
This is well-understood & explored algorithmically, but nevertheless a very delicate computation, as the term regularized indicates. You are subtracting a rectangle, but there is nothing special about a rectangle—"degenerate" situations may occur. You really need to consider the general situation. So I recommend you look at general resources, such as

"Boolean operations on general planar polygons." M. Riveroa, F.R. Feitob. Computers & Graphics. Volume 24, Issue 6, December 2000, Pages 881–896 (Elsevier link)

or

"A General Polygon Clipping Library." Version 2.32. Alan Murta. (link)

The upperleft corner of Murta's Fig.2 illustrates a complicated polygon difference (and the remaining images illustrate other Boolean operations).
      Boolean Ops http://cs.smith.edu/%7Eorourke/MathOverflow/BooleanOps.jpg

I suggest you investigate the CGAL manual, Chapter 19: "2D Regularized Boolean Set-Operations". Here is an example of polygon difference:
            PolygonSubtraction
This is well-understood & explored algorithmically, but nevertheless a very delicate computation, as the term regularized indicates. You are subtracting a rectangle, but there is nothing special about a rectangle—"degenerate" situations may occur. You really need to consider the general situation. So I recommend you look at general resources, such as

"Boolean operations on general planar polygons." M. Riveroa, F.R. Feitob. Computers & Graphics. Volume 24, Issue 6, December 2000, Pages 881–896 (Elsevier link)

or

"A General Polygon Clipping Library." Version 2.32. Alan Murta. (link)

The upperleft corner of Murta's Fig.2 illustrates a complicated polygon difference (and the remaining images illustrate other Boolean operations).
      Boolean Ops

added 43 characters in body
Source Link
Joseph O'Rourke
  • 150.9k
  • 36
  • 358
  • 958

I suggest you investigate the CGAL manual, Chapter 19: "2D Regularized Boolean Set-Operations". Here is an example of polygon difference:
            PolygonSubtraction http://cs.smith.edu/%7Eorourke/MathOverflow/TriangleSubtraction.jpg
This is well-understood & explored algorithmically, but nevertheless a very delicate computation, as the term regularized indicates. You are subtracting a rectangle, but there is nothing special about a rectanglerectangle—"degenerate" situations may occur. You really need to consider the general situation. So I recommend you look at general resources, such as

"Boolean operations on general planar polygons." M. Riveroa, F.R. Feitob. Computers & Graphics. Volume 24, Issue 6, December 2000, Pages 881–896 (Elsevier link)

or

"A General Polygon Clipping Library." Version 2.32. Alan Murta. (link)

The upperleft corner of hisMurta's Fig.2 illustrates a complicated polygon difference (and the remaining images illustrate other Boolean operations).
      Boolean Ops http://cs.smith.edu/%7Eorourke/MathOverflow/BooleanOps.jpg

I suggest you investigate the CGAL manual, Chapter 19: "2D Regularized Boolean Set-Operations". Here is an example of polygon difference:
            PolygonSubtraction http://cs.smith.edu/%7Eorourke/MathOverflow/TriangleSubtraction.jpg
This is well-understood & explored algorithmically, but nevertheless a very delicate computation, as the term regularized indicates. You are subtracting a rectangle, but there is nothing special about a rectangle. You really need to consider the general situation. So I recommend you look at general resources, such as

"Boolean operations on general planar polygons." M. Riveroa, F.R. Feitob. Computers & Graphics. Volume 24, Issue 6, December 2000, Pages 881–896 (Elsevier link)

or

"A General Polygon Clipping Library." Version 2.32. Alan Murta. (link)

The upperleft corner of his Fig.2 illustrates a complicated polygon difference (and the remaining images illustrate other Boolean operations).
      Boolean Ops http://cs.smith.edu/%7Eorourke/MathOverflow/BooleanOps.jpg

I suggest you investigate the CGAL manual, Chapter 19: "2D Regularized Boolean Set-Operations". Here is an example of polygon difference:
            PolygonSubtraction http://cs.smith.edu/%7Eorourke/MathOverflow/TriangleSubtraction.jpg
This is well-understood & explored algorithmically, but nevertheless a very delicate computation, as the term regularized indicates. You are subtracting a rectangle, but there is nothing special about a rectangle—"degenerate" situations may occur. You really need to consider the general situation. So I recommend you look at general resources, such as

"Boolean operations on general planar polygons." M. Riveroa, F.R. Feitob. Computers & Graphics. Volume 24, Issue 6, December 2000, Pages 881–896 (Elsevier link)

or

"A General Polygon Clipping Library." Version 2.32. Alan Murta. (link)

The upperleft corner of Murta's Fig.2 illustrates a complicated polygon difference (and the remaining images illustrate other Boolean operations).
      Boolean Ops http://cs.smith.edu/%7Eorourke/MathOverflow/BooleanOps.jpg

Source Link
Joseph O'Rourke
  • 150.9k
  • 36
  • 358
  • 958

I suggest you investigate the CGAL manual, Chapter 19: "2D Regularized Boolean Set-Operations". Here is an example of polygon difference:
            PolygonSubtraction http://cs.smith.edu/%7Eorourke/MathOverflow/TriangleSubtraction.jpg
This is well-understood & explored algorithmically, but nevertheless a very delicate computation, as the term regularized indicates. You are subtracting a rectangle, but there is nothing special about a rectangle. You really need to consider the general situation. So I recommend you look at general resources, such as

"Boolean operations on general planar polygons." M. Riveroa, F.R. Feitob. Computers & Graphics. Volume 24, Issue 6, December 2000, Pages 881–896 (Elsevier link)

or

"A General Polygon Clipping Library." Version 2.32. Alan Murta. (link)

The upperleft corner of his Fig.2 illustrates a complicated polygon difference (and the remaining images illustrate other Boolean operations).
      Boolean Ops http://cs.smith.edu/%7Eorourke/MathOverflow/BooleanOps.jpg