allow default layer off. disable moves layers default
This commit is contained in:
parent
de26819d61
commit
024be442bd
4 changed files with 13 additions and 5 deletions
|
|
@ -115,7 +115,8 @@
|
|||
faces: codec.allocFloat32Array(layer.faces),
|
||||
color: layer.color,
|
||||
paths: layer.paths,
|
||||
cpath: layer.cpath
|
||||
cpath: layer.cpath,
|
||||
off: layer.off
|
||||
} })
|
||||
};
|
||||
return enc;
|
||||
|
|
@ -130,7 +131,8 @@
|
|||
faces: v.data[i].faces,
|
||||
color: v.data[i].color,
|
||||
paths: v.data[i].paths,
|
||||
cpath: v.data[i].cpath
|
||||
cpath: v.data[i].cpath,
|
||||
off: v.data[i].off
|
||||
};
|
||||
}
|
||||
return render;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
};
|
||||
}
|
||||
|
||||
setLayer(layer, colors) {
|
||||
setLayer(layer, colors, off) {
|
||||
let layers = this.layers;
|
||||
if (typeof(colors) === 'number') {
|
||||
colors = {
|
||||
|
|
@ -28,6 +28,7 @@
|
|||
};
|
||||
}
|
||||
this.current = layers[layer] = layers[layer] || {
|
||||
off: off === true,
|
||||
lines: [],
|
||||
polys: [],
|
||||
faces: [],
|
||||
|
|
|
|||
|
|
@ -105,8 +105,10 @@
|
|||
})
|
||||
};
|
||||
}
|
||||
const defstate = !data.off;
|
||||
const ctrl = DYN[label];
|
||||
ctrl.toggle.checked = true;
|
||||
|
||||
ctrl.toggle.checked = defstate;
|
||||
|
||||
const { polys, lines, faces, paths, cpath } = data;
|
||||
if (polys.length || lines.length) {
|
||||
|
|
@ -127,6 +129,7 @@
|
|||
group.add(new THREE.LineSegments(geo, mat));
|
||||
}
|
||||
ctrl.group.push(mat);
|
||||
mat.visible = defstate;
|
||||
}
|
||||
if (faces.length) {
|
||||
const mat = newMat(data);
|
||||
|
|
@ -139,6 +142,7 @@
|
|||
mesh.receiveShadow = true;
|
||||
group.add(mesh);
|
||||
ctrl.group.push(mat);
|
||||
mat.visible = defstate;
|
||||
}
|
||||
if (paths.length) {
|
||||
let mat = [];
|
||||
|
|
@ -147,6 +151,7 @@
|
|||
} else {
|
||||
mat.push(newMat(data));
|
||||
}
|
||||
mat.forEach(m => m.visible = defstate);
|
||||
// const mat = newMat(data);
|
||||
paths.forEach((path, i) => {
|
||||
const { index, faces, z, colors } = path;
|
||||
|
|
|
|||
|
|
@ -455,7 +455,7 @@
|
|||
}
|
||||
|
||||
output
|
||||
.setLayer('move', moveColor)
|
||||
.setLayer('move', moveColor, true)
|
||||
.addPolys(moves, { thin: true, z: opts.z });
|
||||
Object.values(prints).forEach(array => {
|
||||
array.forEach(poly => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue