genCubicBezierTuplesFromPoints method

List<BezierTuple> genCubicBezierTuplesFromPoints(
  1. List<Vector3> points
)

Implementation

List<BezierTuple> genCubicBezierTuplesFromPoints(List<Vector3> points) {
  var nppc = nPointsPerCurve;
  var remainder = points.length % nppc;
  points = points
      .whereIndexed((index, element) => index < points.length - remainder)
      .toList();
  return [
    for (var i in range(end: points.length, step: 4))
      Tuple4(points[i + 0], points[i + 1], points[i + 2], points[i + 3])
  ];
}