diff --git a/src/geo/polygon.js b/src/geo/polygon.js index 7a5d8c6e..48fdf98b 100644 --- a/src/geo/polygon.js +++ b/src/geo/polygon.js @@ -48,7 +48,7 @@ this.depth = 0; // depth nested from top parent (density for support fill) this.delete = false; // for culling during tracing this.fillang = null; // hinted fill angle - this.fills = null; // fill lines (only used by supports currently) + this.fill = null; // fill lines (only used by supports currently) if (points) this.addPoints(points); } diff --git a/src/kiri/codec.js b/src/kiri/codec.js index ff7df8bc..1b032dd8 100644 --- a/src/kiri/codec.js +++ b/src/kiri/codec.js @@ -203,6 +203,13 @@ } }); } + if (d.cpath) { + d.cpath.forEach(rec => { + if (rec.count === null) { + rec.count = Infinity; + } + }); + } // console.log('<--',d); } return render; diff --git a/src/kiri/init.js b/src/kiri/init.js index 46b4d19d..7c668934 100644 --- a/src/kiri/init.js +++ b/src/kiri/init.js @@ -1944,7 +1944,9 @@ } if (event && event.target.nodeName === "CANVAS") { if (selection) { - platform.select(selection.object.widget, event.shiftKey); + if (selection.object.widget) { + platform.select(selection.object.widget, event.shiftKey); + } } else { platform.deselect(); } diff --git a/src/kiri/main.js b/src/kiri/main.js index 7519f271..aaf5fcff 100644 --- a/src/kiri/main.js +++ b/src/kiri/main.js @@ -992,6 +992,7 @@ if (viewMode !== VIEWS.ARRANGE) return; forSelectedGroups(function (w) { w.rotate(x, y, z); + API.event.emit('widget.rotate', {widget: w, x, y, z}); }); updateSelectedBounds(); platform.compute_max_z(); diff --git a/src/mode/fdm/client.js b/src/mode/fdm/client.js index 0ea5fd47..7194fc72 100644 --- a/src/mode/fdm/client.js +++ b/src/mode/fdm/client.js @@ -70,27 +70,22 @@ api.event.on("key.esc", () => { func.sdone() }); - api.event.on("selection.rotate", rot => { - const {x, y, z} = rot; + api.event.on("widget.rotate", rot => { + const {widget, x, y, z} = rot; if (x || y) { - API.selection.widgets().forEach(widget => { - clearWidgetSupports(widget); - }); - API.conf.save(); + clearWidgetSupports(widget); } else { - API.selection.widgets().forEach(widget => { - let ann = API.widgets.annotate(widget.id); - let sups = ann.support || []; - sups.forEach(sup => { - let wsup = widget.sups[sup.id]; - let vc = new THREE.Vector3(sup.x, sup.y, sup.z); - let m4 = new THREE.Matrix4(); - m4 = m4.makeRotationFromEuler(new THREE.Euler(x || 0, y || 0, z || 0)); - vc.applyMatrix4(m4); - wsup.box.position.x = wsup.x = sup.x = vc.x; - wsup.box.position.y = wsup.y = sup.y = vc.y; - wsup.box.position.z = wsup.z = sup.z = vc.z; - }); + let ann = API.widgets.annotate(widget.id); + let sups = ann.support || []; + sups.forEach(sup => { + let wsup = widget.sups[sup.id]; + let vc = new THREE.Vector3(sup.x, sup.y, sup.z); + let m4 = new THREE.Matrix4(); + m4 = m4.makeRotationFromEuler(new THREE.Euler(x || 0, y || 0, z || 0)); + vc.applyMatrix4(m4); + wsup.box.position.x = wsup.x = sup.x = vc.x; + wsup.box.position.y = wsup.y = sup.y = vc.y; + wsup.box.position.z = wsup.z = sup.z = vc.z; }); } }); diff --git a/src/mode/sla/export.js b/src/mode/sla/export.js index a26166bb..a1461877 100644 --- a/src/mode/sla/export.js +++ b/src/mode/sla/export.js @@ -462,6 +462,19 @@ } } + // for unbound workers + // if (self.WASM) { + // let {exports} = wasmInstance; + // let heap = new Uint8Array(exports.memory.buffer); + // self.wasm = { + // heap, + // memory: exports.memory, + // // heap: wasmMemory, + // // memory: memoryBytes, + // render: exports.render, + // rle_encode: exports.rle_encode + // }; + // } else // load renderer code in worker context only fetch('/wasm/kiri-sla.wasm') .then(response => response.arrayBuffer())