Boolean principle using graphs |
A
|
B
|
A OR B
|
---|---|---|
0
|
0
|
0
|
0
|
1
|
1
|
1
|
0
|
1
|
1
|
1
|
1
|
The result can be seen in Result of OR operation. . Each blue area is a polygon. The advantage of this method is that the resulting polygons do not contain holes and are not selfintersecting. The disadvantage is that the result contains many polygons. This is why it is better to assemble as much as possible of the enclosed areas into one polygon. The result is shown in optimized result. . Only one polygon is used now to represent the complete result. In general this method leads to polygons that contain holes. Holes within a polygon are defined as empty areas that are within the outside boundary of the polygon. They can/are maintained as part of the polygon, by linking each hole into the outside boundary with two (extra) segments. Within the graph structure, outside boundaries and holes are available as separate graph structures, converting the graph structure back to polygons requires linking of the holes. A different polygon data structure that would maintain holes not directly as part of a polygon, could skip this step.