public void AddInnerFill(Transform root, Vector3[] points, float pathLength)
 {
     Polygon poly = new Polygon(points);
     Bounds b = points.GetBounds();
     float s = size * 2 * spacing;
     int index = 0;
     for (float x = b.min.x; x < b.max.x; x += s) {
     for (float y = b.min.y; y < b.max.y; y += s) {
         Vector3 p = new Vector3(x, y, 0);
         if (poly.Contains(p)) {
             AddObject(root, p, Vector3.right, ref index, 0);
         }
     }
     }
     root.DestroyChildrenAfter(index);
 }
 public void AddStroke(Transform root, Vector3[] points, float pathLength, bool closed)
 {
     int segments = points.Length + (closed?1:0);
     int index = 0;
     float distTraveled = 0;
     for (int i = 1; i < segments; i++) {
     AddStrokeSegment(root, points[i-1], points[i%points.Length], pathLength, ref distTraveled, ref index);
     }
     root.DestroyChildrenAfter(index);
 }