migrate fdm, sla, laser to new core slicer

This commit is contained in:
Stewart Allen 2022-02-16 22:57:12 -05:00
commit a438275e9a
11 changed files with 357 additions and 1081 deletions

View file

@ -17,9 +17,29 @@
registerDecoder: registerDecoder,
allocFloat32Array: allocFloat32Array,
encodePointArray,
decodePointArray
decodePointArray,
toCodable
};
function toCodable(object) {
let o = {};
for (let [key, val] of Object.entries(object)) {
switch (typeof val) {
case 'function':
break;
case 'object':
if (Array.isArray(val)) {
val = val.map(v => toCodable(v));
} else {
val = toCodable(val);
}
default:
o[key] = val;
}
}
return o;
}
function allocFloat32Array(arg) {
if (arg.byteLength) {
// already a float array