Vertex Coincidence:
Vertex coincidence occurs when two vertices have the same coordinates. To handle this case, you can add a check in your data structure to prevent duplicate vertices from being created. When adding a new vertex, compare its coordinates with existing vertices, and if there is a match, use the existing vertex instead of creating a new one.
Edge Coincidence:
Edge coincidence occurs when two edges have the same start and end vertices or the same coordinates. To handle this case, you can implement a data structure to store edges uniquely based on their start and end vertices. When adding a new edge, check if an edge with the same start and end vertices already exists. If it does, you can choose to update the existing edge or ignore the new edge.
Edge Intersection:
Edge intersection occurs when two edges cross each other. This is a more complex case and requires advanced algorithms like line intersection algorithms or sweep line algorithms. You'll need to keep track of the edges' orientations and intersections to handle this case properly. The Bentley-Ottmann algorithm is commonly used to handle edge intersections efficiently in computational geometry.
Zero-Length Edge:
A zero-length edge occurs when the start and end vertices of an edge coincide. This case can lead to degenerate polygons or invalid data. To handle this, you can add a check when adding edges to ensure that their start and end vertices are not the same.
Here are some resources:
"Computational Geometry: Algorithms and Applications" by Mark de Berg, Otfried Cheong, Marc van Kreveld, and Mark Overmars. This book covers computational geometry concepts, including trapezoid maps and algorithms for handling edge intersections.
"A Simple Trapezoid Map Implementation" by Steven Fortune. This paper provides a detailed explanation of a trapezoid map implementation using the sweep line algorithm.
"Trapezoidal Map" Wikipedia page: The Wikipedia page on trapezoidal maps provides a good overview and references to further resources.
Additional Links: