segmented property

List<SPath> get segmented

Thinking looking down on orange segments

Implementation

List<SPath> get segmented {
  if (edges.length < 2) {
    throw Exception("You must have at least two edges to segment a (S)Path");
  }
  final c = centroid;
  final n = edges.length;
  List<SPath> paths = [];
  for (var i = 0; i < n; i++) {
    final p = SPath(edges[i].start);
    p.edges.add(edges[i].copy());
    p.currentPoint = edges[i].end;
    p.line(to: c);
    p.close();
    paths.add(p);
  }
  return paths;
}