getSpacedPoints method

List<Vector?> getSpacedPoints([
  1. int divisions = 5,
  2. int offset = 0
])

divisions -- number of pieces to divide the curve into. Default is 5.

Returns a set of divisions + 1 equi-spaced points using getPointAt( u ).

Implementation

List<Vector?> getSpacedPoints([int divisions = 5, int offset = 0]) {
  final List<Vector?> points = [];

  for (int d = 0; d <= divisions; d++) {
    points.add(getPointAt(d / divisions));
  }

  return points;
}