-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
This tiny fix helps out when passing in a fill that doesn't appear to produce good output.
Stitch.Optimize = {
joinPolylines: function (polylines, maxJoinDistance) {
- let joinedPolylines = [polylines[0]];
+ //––– safety: drop falsy / empty polylines and short-circuit if nothing left
+ polylines = polylines.filter(p => p && p.vertices && p.vertices.length);
+ if (polylines.length === 0) return [];
+
+ let joinedPolylines = [polylines[0]];
let queue = polylines.slice(1);
Metadata
Metadata
Assignees
Labels
No labels