extract static method

List<Coordinate> extract(
  1. List<Coordinate> pts,
  2. int start,
  3. int end
)

Implementation

static List<Coordinate> extract(List<Coordinate> pts, int start, int end) {
  start = MathUtil.clamp(start, 0, pts.length);
  end = MathUtil.clamp(end, -1, pts.length);
  int npts = (end - start) + 1;
  if (end < 0) npts = 0;

  if (start >= pts.length) npts = 0;

  if (end < start) npts = 0;
  if (npts == 0) return [];
  return pts.sublist(start, end + 1).toList();
}