Breakpoint¶
-
class
foronoi.nodes.
Breakpoint
(breakpoint: tuple, edge=None)¶ A breakpoint between two arcs.
The breakpoint is stored by an ordered tuple of sites (
p_i
,p_j
) wherep_i
defines the parabola left of the breakpoint andp_j
defines the parabola to the right. Furthermore, the internal nodev
has a pointer to the half edge in the doubly connected edge list of the Voronoi diagram. More precisely,v
has a pointer to one of the half-edges of the edge being traced out by the breakpoint represented byv
.- Parameters
breakpoint ((Point, Point)) – A point where two arcs intersect, represented as a tuple of the two site points that the arcs refer to
-
does_intersect
()¶ A guard that handles the edge-case where two arcs were initialized at the same time due to their sites having the same
y
-coordinate. This guard makes sure that the left arc intersects once with the right arc and not the other way around.- Returns
intersects – Returns false when
p_i
andp_j
have the same y-coordinate andp_j
is situated left of p_i.- Return type
bool
-
get_intersection
(l, max_y=None)¶ Calculate the coordinates of the intersection Modified from https://www.cs.hmc.edu/~mbrubeck/voronoi.html
- Parameters
l (float) – The y-coordinate of the sweep line
max_y (float) – The top of the bounding box/polygon for clipping infinite breakpoints
- Returns
coordinate – The current coordinates of the breakpoint
- Return type