filter dup slice indices in cam. fix factor declaration

This commit is contained in:
Stewart Allen 2021-09-21 13:17:05 -04:00
commit 6051177161
2 changed files with 4 additions and 3 deletions

View file

@ -1100,8 +1100,8 @@
} }
function sliceWidget(widget) { function sliceWidget(widget) {
widget.stack = STACKS.create(widget.id, widget.mesh), widget.stack = STACKS.create(widget.id, widget.mesh);
factor = (widget.getVertices().count / defvert); let factor = (widget.getVertices().count / defvert);
// compensate for zcut (widget moved through floor) // compensate for zcut (widget moved through floor)
widget.stack.obj.view.position.z = widget.track.zcut || 0; widget.stack.obj.view.position.z = widget.track.zcut || 0;

View file

@ -395,7 +395,8 @@
return opt.down ? b-a : a-b; return opt.down ? b-a : a-b;
}); });
} }
// filter duplicate values
array = array.map(v => v.round(5)).filter((e,i,a) => i < 1 || a[i-1] !== a[i]);
return array.map(v => Math.abs(parseFloat(v.toFixed(5)))); return array.map(v => Math.abs(parseFloat(v.toFixed(5))));
} }
} }