Templates
template defaultFor(body, default: untyped) {.dirty.}
- A template for defining the default block to be used when no optional body block is provided. Source Edit
template pathForBounds(d: Delaunator; body: untyped = nil): Path {.dirty.}
-
Returns a Path of the bounds of the triangulation. body will be evaluated for this bounds. Symbols available to body:
- path: Path: The path being constructed
- minX: T: The bound's horizontal minimum.
- minY: T: The bound's vertical minimum.
- maxX: T: The bound's horizontal maximum.
- maxY: T: The bound's vertical maximum.
- x: T: Same as minX
- y: T: Same as minY
- w: T: The bound's width
- h: T: The bound's height
template pathForCircumcenter(d: Delaunator; triangleId: uint32; body: untyped = nil): Path {.dirty.}
-
Returns a Path of the circumcenter constructed from the triangle specified by triangleId. body will be evaluated for this circumcenter. Symbols available to body:
- path: Path: The path being constructed
- tid: uint32: The triangles index of the circumcenter's triangle
- c: array[2, T]: The circumcenter's point location
template pathForCircumcenters(d: Delaunator; body: untyped = nil): Path {.dirty.}
-
Returns a Path of all circumcenters of the triangulation. body will be evaluated for each circumcenter. Symbols available to body:
- path: Path: The path being constructed
- tid: uint32: The triangles index of the circumcenter's triangle
- c: array[2, T]: The circumcenter's point location
template pathForExtents(d: Delaunator; body: untyped = nil): Path {.dirty.}
-
Returns a Path of the extents of the triangulation. body will be evaluated for this extent. Symbols available to body:
- path: Path: The path being constructed
- minX: T: The extent's horizontal minimum.
- minY: T: The extent's vertical minimum.
- maxX: T: The extent's horizontal maximum.
- maxY: T: The extent's vertical maximum.
- x: T: Same as minX
- y: T: Same as minY
- w: T: The extent's width
- h: T: The extent's height
template pathForHalfedge(d: Delaunator; edgeId: int32; body: untyped = nil): Path {. dirty.}
-
Returns a Path of the halfedge specified by edgeId. body will be evaluated for this halfedge. Symbols available to body:
- path: Path: The path being constructed
- eid: int32: The halfedges index of halfedge being considered
- pid: uint32: The point index of the site where the halfedge starts
- qid: uint32: The point index of the site where the halfedge ends
- p: array[2, T]: The halfedge's starting point location
- q: array[2, T]: The halfedge's ending point location
template pathForHull(d: Delaunator; body: untyped = nil): Path {.dirty.}
-
Returns a Path of the triangulation's hull. body will be evaluated for each edge of the hull. Symbols available to body:
- path: Path: The path being constructed
- hid: uint32: The hull index of site the hull edge starts at
- eid: int32: The halfedges index of hull halfedge being considered
- pid: uint32: The point index of the site where the hull halfedge starts
- qid: uint32: The point index of the site where the hull halfedge ends
- p: array[2, T]: The hull halfedge's starting point location
- q: array[2, T]: The hull halfedge's ending point location
template pathForHullSite(d: Delaunator; hullId: uint32; body: untyped = nil): Path {. dirty.}
-
Returns a Path of the site on the hull specified by hullId. body will be evaluated for this hull site. Symbols available to body:
- path: Path: The path being constructed
- hid: uint32: The hull index of site being considered
- pid: uint32: The point index of the site being considered
- p: array[2, T]: The site's point location
template pathForHullSites(d: Delaunator; body: untyped = nil): Path {.dirty.}
-
Returns a Path of all sites on the hull of the triangulation. body will be evaluated for each hull site. Symbols available to body:
- path: Path: The path being constructed
- hid: uint32: The hull index of site being considered
- pid: uint32: The point index of the site being considered
- p: array[2, T]: The site's point location
template pathForRegion(d: Delaunator; siteId: uint32; body: untyped = nil): Path {. dirty.}
-
Returns a Path of the region specified by siteId. body will be evaluated for this region. Symbols available to body:
- path: Path: The path being constructed
- sid: uint32: The point index of the region's site
- verts: seq[array[2, T]]: The points of the region's polygon
template pathForRegionCentroid(d: Delaunator; siteId: uint32; body: untyped = nil): Path {.dirty.}
-
Returns a Path of the region centroid constructed from the site specified by siteId. body will be evaluated for this centroid. Symbols available to body:
- path: Path: The path being constructed
- pid: uint32: The point index of the region's site
- verts: seq[array[2, T]]: The points of the region's polygon
- c: array[2, T]: The centroid's point location
template pathForRegionCentroids(d: Delaunator; body: untyped = nil): Path {. dirty.}
-
Returns a Path of all region centroids of the voronoi diagram. body will be evaluated for each centroid. Symbols available to body:
- path: Path: The path being constructed
- pid: uint32: The point index of the region's site
- verts: seq[array[2, T]]: The points of the region's polygon
- c: array[2, T]: The centroid's point location
template pathForRegionEdges(d: Delaunator; body: untyped = nil): Path {.dirty.}
-
Returns a Path of all region edges (bisectors of halfedges) of the voronoi diagram. body will be evaluated for each region edge. Symbols available to body:
- path: Path: The path being constructed
- eid: int32: The halfedges index of the halfedge bisected by the region edge
- p: array[2, T]: The location of the circumcenter for the triangle of which the halfedge is a part
- q: array[2, T]: For finite regions; The location of the circumcenter for
the triangle of which the halfedge's complement is a part. For infinite regions; The location projected by the halfedge origin's rightmost ray onto the delaunator object's defined bounds.
Source Edit template pathForSite(d: Delaunator; siteId: uint32; body: untyped = nil): Path {. dirty.}
-
Returns a Path of the site specified by siteId. body will be evaluated for this site. Symbols available to body:
- path: Path: The path being constructed
- pid: uint32: The point index of the site being considered
- p: array[2, T]: The site's point location
template pathForSites(d: Delaunator; body: untyped = nil): Path {.dirty.}
-
Returns a Path of all sites of the triangulation. body will be evaluated for each site. Symbols available to body:
- path: Path: The path being constructed
- pid: uint32: The point index of the site being considered
- p: array[2, T]: The site's point location
template pathForTriangle(d: Delaunator; triangleId: uint32; body: untyped = nil): Path {. dirty.}
-
Returns a Path of the triangle specified by triangleId. body will be evaluated for this triangle. Symbols available to body:
- path: Path: The path being constructed
- tid: uint32: The triangles index of the specified triangle
- pntIds: seq[uint32]: The point indices of the specified triangle
- pid: uint32: The 1st site's point index of the specified triangle
- qid: uint32: The 2nd site's point index of the specified triangle
- rid: uint32: The 3rd site's point index of the specified triangle
- p: array[2, T]: The 1st site's location
- q: array[2, T]: The 2nd site's location
- r: array[2, T]: The 3rd site's location
template pathForTriangleCentroid(d: Delaunator; triangleId: uint32; body: untyped = nil): Path {.dirty.}
-
Returns a Path of the centroid constructed from the triangle specified by triangleId. body will be evaluated for this centroid. Symbols available to body:
- path: Path: The path being constructed
- tid: uint32: The triangles index of the centroid's triangle
- c: array[2, T]: The centroid's point location
template pathForTriangleCentroids(d: Delaunator; body: untyped = nil): Path {. dirty.}
-
Returns a Path of all triangle centroids of the triangulation. body will be evaluated for each centroid. Symbols available to body:
- path: Path: The path being constructed
- tid: uint32: The triangles index of the centroid's triangle
- c: array[2, T]: The centroid's point location
template pathForTriangleEdges(d: Delaunator; body: untyped = nil): Path {.dirty.}
-
Returns a Path of all edges of the triangulation. body will be evaluated for each edge. Symbols available to body:
- path: Path: The path being constructed
- eid: int32: The halfedges index of halfedge chosen to represent the edge
- tid: uint32: The triangles index of the triangle the halfedge above belongs to
- pid: uint32: The point index of the site where the halfedge starts
- qid: uint32: The point index of the site where the halfedge ends
- p: array[2, T]: The halfedge's starting point location
- q: array[2, T]: The halfedge's ending point location
template pathForTriangleSites(d: Delaunator; triangleId: uint32; body: untyped = nil): Path {.dirty.}
-
Returns a Path of all sites comprising the triangle specified by triangleId. body will be evaluated for the triangle. Symbols available to body:
- path: Path: The path being constructed
- tid: uint32: The triangles index of the specified triangle
- pntIds: seq[uint32]: The point indices of the specified triangle
- pid: uint32: The 1st site's point index of the specified triangle
- qid: uint32: The 2nd site's point index of the specified triangle
- rid: uint32: The 3rd site's point index of the specified triangle
- p: array[2, T]: The 1st site's location
- q: array[2, T]: The 2nd site's location
- r: array[2, T]: The 3rd site's location
template pathsForHalfedgesAroundSite(d: Delaunator; siteId: uint32; body: untyped = nil): seq[Path] {.dirty.}
-
Returns a seq[Path] of all halfedges leading to the site specified by siteId. body will be evaluated for each halfedge. Symbols available to body:
- path: Path: The path being constructed
- sid: uint32: The point index of the site being considered
- eid: int32: The halfedges index of halfedge being considered
- pid: uint32: The point index of the site where the halfedge starts
- qid: uint32: The point index of the site where the halfedge ends
- p: array[2, T]: The halfedge's starting point location
- q: array[2, T]: The halfedge's ending point location
template pathsForRegions(d: Delaunator; body: untyped = nil): seq[Path] {.dirty.}
-
Returns a seq[Path] of all regions of the voronoi diagram. body will be evaluated for each region. Symbols available to body:
- path: Path: The path being constructed
- sid: uint32: The point index of the region's site
- verts: seq[array[2, T]]: The points of the region's polygon
template pathsForTriangles(d: Delaunator; body: untyped = nil): seq[Path] {. dirty.}
-
Returns a seq[Path] of all triangles of the triangulation. body will be evaluated for each triangle. Symbols available to body:
- path: Path: The path being constructed
- tid: uint32: The triangles index of the triangle being considered
- pid: uint32: The 1st site's point index of the triangle being considered
- qid: uint32: The 2nd site's point index of the triangle being considered
- rid: uint32: The 3rd site's point index of the triangle being considered
- p: array[2, T]: The 1st site's location
- q: array[2, T]: The 2nd site's location
- r: array[2, T]: The 3rd site's location