Point¶
-
class
foronoi.graph.
Point
(x=None, y=None, name=None, first_edge=None)¶ A cell point a.k.a. a site. Extends the
Coordinate
class.Examples
Site operations
>>> size: float = site.area() # The area of the cell >>> borders: List[HalfEdge] = site.borders() # Borders around this cell point >>> vertices: List[Vertex] = site.vertices() # Vertices around this cell point >>> site_x: float = site.x # X-coordinate of the site >>> site_xy: [float, float] = site.xy # (x, y)-coordinates of the site >>> first_edge: HalfEdge = site.first_edge # First edge of the site's border
- Parameters
x (Decimal) – The x-coordinate of the point
y (Decimal) – They y-coordinate of the point
metadata (dict) – Optional metadata stored in a dictionary
name (str) – A name to easily identify this point
first_edge (HalfEdge) – Pointer to the first edge
-
name
¶ A name to easily identify this point
- Type
str
-
area
(digits=None)¶ Calculate the cell size of the cell that this point is the cell point of. Under the hood, the shoelace algorithm is used.
- Parameters
digits (int) – The number of digits to round to
- Returns
area – The area of the cell
- Return type
float