add index angle to slices and pass to client
This commit is contained in:
parent
c61fadd68b
commit
24af93550d
2 changed files with 5 additions and 0 deletions
|
|
@ -261,6 +261,7 @@ Slice.prototype.encode = function(state) {
|
||||||
index: this.index,
|
index: this.index,
|
||||||
layers: encode(this.layers, state)
|
layers: encode(this.layers, state)
|
||||||
};
|
};
|
||||||
|
if (this.angle !== undefined) rv.angle = this.angle;
|
||||||
// aggressively free memory
|
// aggressively free memory
|
||||||
if (freeMem) this.layers = undefined;
|
if (freeMem) this.layers = undefined;
|
||||||
return rv;
|
return rv;
|
||||||
|
|
@ -269,6 +270,7 @@ Slice.prototype.encode = function(state) {
|
||||||
registerDecoder(TYPE.SLICE, function(v, state) {
|
registerDecoder(TYPE.SLICE, function(v, state) {
|
||||||
let slice = newSlice(v.z, state.mesh ? state.mesh.newGroup() : null);
|
let slice = newSlice(v.z, state.mesh ? state.mesh.newGroup() : null);
|
||||||
|
|
||||||
|
if (v.angle !== undefined) slice.angle = v.angle;
|
||||||
slice.index = v.index;
|
slice.index = v.index;
|
||||||
slice.layers = decode(v.layers, state)
|
slice.layers = decode(v.layers, state)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -294,6 +294,9 @@ export async function cam_slice(settings, widget, onupdate, ondone) {
|
||||||
}
|
}
|
||||||
sliceAll.appendAll(slices);
|
sliceAll.appendAll(slices);
|
||||||
if (addIndexing && axisIndex !== undefined) {
|
if (addIndexing && axisIndex !== undefined) {
|
||||||
|
for (let slice of slices) {
|
||||||
|
slice.angle = axisIndex;
|
||||||
|
}
|
||||||
// update slice cam lines to add axis indexing
|
// update slice cam lines to add axis indexing
|
||||||
for (let slice of slices.filter(s => s.camLines)) {
|
for (let slice of slices.filter(s => s.camLines)) {
|
||||||
addPolyIndexing(slice.camLines, -axisIndex);
|
addPolyIndexing(slice.camLines, -axisIndex);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue