Top Banner
Boolean Operations on Polygons Presented by Kevin Hardy
22
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Boolean Operations on Polygons Presented by Kevin Hardy.

Boolean Operations on Polygons

Presented by Kevin Hardy

Page 2: Boolean Operations on Polygons Presented by Kevin Hardy.
Page 3: Boolean Operations on Polygons Presented by Kevin Hardy.

George Boole (1815-1864)

• Born Lincoln, England, on November 2, 1815.• Boole's work in symbolic logic is collectively

known as "Boolean algebra" • Truth Tables/Logic Circuits• Everyday usage- The use of "And, Or, and Not"

when selecting the appropriate options for connecting search terms to find information in search engines

Page 4: Boolean Operations on Polygons Presented by Kevin Hardy.

What is a Polygon

• A polygon is a closed figure made by joining line segments, where each line segment intersects exactly two others.

• The points at where these line segments join together are called vertices.

Page 5: Boolean Operations on Polygons Presented by Kevin Hardy.

Picture of Polygons

Page 6: Boolean Operations on Polygons Presented by Kevin Hardy.

The Boolean Operations with Polygons

• Union

• Intersection

• Difference

Page 7: Boolean Operations on Polygons Presented by Kevin Hardy.

Union Definition

• If A is a Polygon and B is a Polygon then by the union of A with B we mean all of the the points contained in A and all of the points contained in B.

• The union of A with B will sometimes be denoted by A (the "cup" union sign) B and sometimes by A+B.

Page 8: Boolean Operations on Polygons Presented by Kevin Hardy.

Union Picture

A

B

A “UNION” B

Page 9: Boolean Operations on Polygons Presented by Kevin Hardy.

Union Algorithm

• Build a list of vertices for each polygon A and B (must be in order)

• Find all the intersection points of the edges of A and B

Page 10: Boolean Operations on Polygons Presented by Kevin Hardy.

Union Algorithm

• Rebuild lists including intersecting points in the order they arrive in the polygon

• Find a point on the boundary polygon of A that is outside of B

Page 11: Boolean Operations on Polygons Presented by Kevin Hardy.

Union Algorithm

• Starting at that point, trace the boundary of A to the first intersection point with B (in the order of your list)

• At the intersection point, continue to trace the polygon according to list B

Page 12: Boolean Operations on Polygons Presented by Kevin Hardy.

Union Algorithm

• Following this pattern, once you get to the next intersection point, continue to trace the polygon according to list A again

• The Algorithm is complete when you return to the initial starting point

Page 13: Boolean Operations on Polygons Presented by Kevin Hardy.

Intersection Definiton

• If A is a Polygon and B is a Polygon then by the intersection of A with B we mean all of the points contained within Polygon A which are also contained within Polygon B.

• The intersection of A with B will sometimes be denoted by A (the "cap" intersection sign) B and sometimes by A*B.

Page 14: Boolean Operations on Polygons Presented by Kevin Hardy.

Intersection Picture

A

B

A “INTERSECT” B

Page 15: Boolean Operations on Polygons Presented by Kevin Hardy.

Intersection Algorithm

• Build a list of vertices for each polygon A and B (must be in order)

• Find all the intersection points of the edges of A and B

• Rebuild lists including intersecting points in the order they arrive in the polygon

• Find a point on the boundary polygon A that is also on the boundary polygon of B (an intersecting point)

Page 16: Boolean Operations on Polygons Presented by Kevin Hardy.

Intersection Algorithm

• Starting at that point, trace the boundary of A (according to list A) to the next intersection point with B

• At the intersection point, continue to trace the polygon according to list B

• The Algorithm is complete when you return to the initial starting point

Page 17: Boolean Operations on Polygons Presented by Kevin Hardy.

Difference Definition

• If A is a Polygon and B is a Polygon then by the difference of A with B is meant all of the points contained within Polygon A without all of the points contained within Polygon B

• The of of A with B will sometimes be denoted by A-B

Page 18: Boolean Operations on Polygons Presented by Kevin Hardy.

Difference Picture

A - B B-A

A

B

Page 19: Boolean Operations on Polygons Presented by Kevin Hardy.

Difference Algorithm

• Build a list of vertices for each polygon A and B (must be in order)

• Find all the intersection points of the edges of A and B

• Rebuild lists including intersecting points in the order they arrive in the polygon

Page 20: Boolean Operations on Polygons Presented by Kevin Hardy.

Difference Algorithm

• Find a point on the boundary polygon of A that is outside of B

• Starting at point that point, trace the boundary of A (according to the list) to the next intersection point with B

Page 21: Boolean Operations on Polygons Presented by Kevin Hardy.

Difference Algorithm

• At that intersection point, like the Union and Intersection algorithms, continue to trace according to list B, BUT in reverse order until the next intersection point with A

• At that Intersection point, continue to follow A, going forward through the list.

• Repeat this pattern. The algorithm is complete when you reach the original point.

Page 22: Boolean Operations on Polygons Presented by Kevin Hardy.

Recapping Boolean Operations on Polygons

• Union- All of the points contained within Polygon A, and all of the points contained within Polygon B– Like logical operator OR

• Intersection- Takes all of the points within A that are also contained within B– Like logical operator AND

• Difference- Takes all of the points within A that are not also within B– Like logical operator NOT