fix support and rotate, codec for server workers, click on support error
This commit is contained in:
parent
19323b2958
commit
975dbde473
6 changed files with 39 additions and 21 deletions
|
|
@ -48,7 +48,7 @@
|
||||||
this.depth = 0; // depth nested from top parent (density for support fill)
|
this.depth = 0; // depth nested from top parent (density for support fill)
|
||||||
this.delete = false; // for culling during tracing
|
this.delete = false; // for culling during tracing
|
||||||
this.fillang = null; // hinted fill angle
|
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);
|
if (points) this.addPoints(points);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -203,6 +203,13 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (d.cpath) {
|
||||||
|
d.cpath.forEach(rec => {
|
||||||
|
if (rec.count === null) {
|
||||||
|
rec.count = Infinity;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
// console.log('<--',d);
|
// console.log('<--',d);
|
||||||
}
|
}
|
||||||
return render;
|
return render;
|
||||||
|
|
|
||||||
|
|
@ -1944,7 +1944,9 @@
|
||||||
}
|
}
|
||||||
if (event && event.target.nodeName === "CANVAS") {
|
if (event && event.target.nodeName === "CANVAS") {
|
||||||
if (selection) {
|
if (selection) {
|
||||||
platform.select(selection.object.widget, event.shiftKey);
|
if (selection.object.widget) {
|
||||||
|
platform.select(selection.object.widget, event.shiftKey);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
platform.deselect();
|
platform.deselect();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -992,6 +992,7 @@
|
||||||
if (viewMode !== VIEWS.ARRANGE) return;
|
if (viewMode !== VIEWS.ARRANGE) return;
|
||||||
forSelectedGroups(function (w) {
|
forSelectedGroups(function (w) {
|
||||||
w.rotate(x, y, z);
|
w.rotate(x, y, z);
|
||||||
|
API.event.emit('widget.rotate', {widget: w, x, y, z});
|
||||||
});
|
});
|
||||||
updateSelectedBounds();
|
updateSelectedBounds();
|
||||||
platform.compute_max_z();
|
platform.compute_max_z();
|
||||||
|
|
|
||||||
|
|
@ -70,27 +70,22 @@
|
||||||
api.event.on("key.esc", () => {
|
api.event.on("key.esc", () => {
|
||||||
func.sdone()
|
func.sdone()
|
||||||
});
|
});
|
||||||
api.event.on("selection.rotate", rot => {
|
api.event.on("widget.rotate", rot => {
|
||||||
const {x, y, z} = rot;
|
const {widget, x, y, z} = rot;
|
||||||
if (x || y) {
|
if (x || y) {
|
||||||
API.selection.widgets().forEach(widget => {
|
clearWidgetSupports(widget);
|
||||||
clearWidgetSupports(widget);
|
|
||||||
});
|
|
||||||
API.conf.save();
|
|
||||||
} else {
|
} else {
|
||||||
API.selection.widgets().forEach(widget => {
|
let ann = API.widgets.annotate(widget.id);
|
||||||
let ann = API.widgets.annotate(widget.id);
|
let sups = ann.support || [];
|
||||||
let sups = ann.support || [];
|
sups.forEach(sup => {
|
||||||
sups.forEach(sup => {
|
let wsup = widget.sups[sup.id];
|
||||||
let wsup = widget.sups[sup.id];
|
let vc = new THREE.Vector3(sup.x, sup.y, sup.z);
|
||||||
let vc = new THREE.Vector3(sup.x, sup.y, sup.z);
|
let m4 = new THREE.Matrix4();
|
||||||
let m4 = new THREE.Matrix4();
|
m4 = m4.makeRotationFromEuler(new THREE.Euler(x || 0, y || 0, z || 0));
|
||||||
m4 = m4.makeRotationFromEuler(new THREE.Euler(x || 0, y || 0, z || 0));
|
vc.applyMatrix4(m4);
|
||||||
vc.applyMatrix4(m4);
|
wsup.box.position.x = wsup.x = sup.x = vc.x;
|
||||||
wsup.box.position.x = wsup.x = sup.x = vc.x;
|
wsup.box.position.y = wsup.y = sup.y = vc.y;
|
||||||
wsup.box.position.y = wsup.y = sup.y = vc.y;
|
wsup.box.position.z = wsup.z = sup.z = vc.z;
|
||||||
wsup.box.position.z = wsup.z = sup.z = vc.z;
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -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
|
// load renderer code in worker context only
|
||||||
fetch('/wasm/kiri-sla.wasm')
|
fetch('/wasm/kiri-sla.wasm')
|
||||||
.then(response => response.arrayBuffer())
|
.then(response => response.arrayBuffer())
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue