Delaunay.from constructor

Delaunay.from(
  1. List<Point<double>> points
)

Allocates memory for a Delaunay triangulation.

Copies points into a Float32List, available from the getter coords.

Implementation

factory Delaunay.from(List<Point<double>> points) {
  final int n = points.length;
  final Float32List coords = Float32List(n << 1);
  for (int i = 0; i < n; i++) {
    final Point<double> p = points[i];
    coords[i * 2] = p.x;
    coords[(i * 2) + 1] = p.y;
  }
  return Delaunay(coords);
}