memory optimization: defer wasm load, reduce point/poly default fields

This commit is contained in:
Stewart Allen 2021-06-17 23:31:05 -04:00
commit 069a599ead
5 changed files with 32 additions and 32 deletions

View file

@ -42,13 +42,13 @@
this.key = key || [x, y, z].toString();
}
this.poly = null; // parent polygon
this.dist = 0.0; // for group intersection sorting and tests
this.p1 = null; // used in sliceIntersect(), connectLines() and intersect()
this.p2 = null; // used in sliceIntersect(), connectLines() and intersect()
// this.dist = 0.0; // for group intersection sorting and tests
// this.p1 = null; // used in sliceIntersect(), connectLines() and intersect()
// this.p2 = null; // used in sliceIntersect(), connectLines() and intersect()
this.pos = 0; // position in group
this.mod = 0; // group length (for modulus of pos)
this.del = false; // for culling
this.group = null; // for grouping in slice intersect, offset lines in trace
// this.mod = 0; // group length (for modulus of pos)
// this.del = false; // for culling
// this.group = null; // for grouping in slice intersect, offset lines in trace
}
/** ******************************************************************

View file

@ -43,12 +43,12 @@
this.area2 = 0.0; // computed as 2x area (sign = direction)
this.perim = 0.0; // for caching the result
this.bounds = new Bounds();
this.inner = null; // array of enclosed polygons (if any)
// this.inner = null; // array of enclosed polygons (if any)
this.parent = null; // enclosing parent polygon
this.depth = 0; // depth nested from top parent (density for support fill)
this.delete = false; // for culling during tracing
this.fillang = null; // hinted fill angle
this.fill = null; // fill lines (only used by supports currently)
// this.fillang = null; // hinted fill angle
// this.fill = null; // fill lines (only used by supports currently)
if (points) this.addPoints(points);
}