clean up codec transferrable object allocation and encoding

This commit is contained in:
Stewart Allen 2022-10-15 00:28:27 -04:00
commit 4ce39c75b5
3 changed files with 39 additions and 31 deletions

View file

@ -54,10 +54,10 @@ class Layers {
off: off === true,
lines: [],
polys: [], // colors are an attribute on polygons
faces: [],
norms: undefined, // vertex normals
cface: undefined, // face color indices
paths: [],
faces: [], // triangles for areas and flats
norms: undefined, // flats vertex normals
cface: undefined, // flats face color indices
paths: [], // 3d extrusion / tube paths (used to be an array, now merged - FIX)
cpath: undefined, // path colors indices
color: colors || {
check: 0,
@ -128,6 +128,7 @@ class Layers {
}
// z planar closed polygonal areas
// used for FDM solids, bridges, flats debug & SLA slice visualization
addAreas(polys, options) {
const faces = this.current.faces;
polys = Array.isArray(polys) ? polys : [ polys ];