fix tab dissociation in rotated asymmetric parts

This commit is contained in:
Stewart Allen 2021-01-11 12:26:19 -05:00
commit e1d3a95aae
3 changed files with 4 additions and 3 deletions

View file

@ -58,7 +58,6 @@
* `B` starting export during animation unleashes chaos
* `B` climb vs conventional not fully consistent after refactor
* `B` outside cutting direction in roughing mode inverted
* `B` on rotation, tabs dissociate from parts whose center changes with rotation
* `F` new registration style: offset cutout
* `F` add climb/conventional into each operation

View file

@ -349,6 +349,7 @@
dx = bm.x + bd.x,
dy = bm.y + bd.y,
dz = bm.z;
this.track.center = { dx, dy, dz };
// move mesh for each widget in group
if (!init) {
this.group.forEach(w => {

View file

@ -742,6 +742,7 @@
let tabs = API.widgets.annotate(widget.id).tab || [];
tabs.forEach(rec => {
let { id, pos, rot } = rec;
let coff = widget.track.center;
let tab = widget.tabs[id];
let m4 = new THREE.Matrix4().makeRotationFromEuler(new THREE.Euler(x || 0, y || 0, z || 0));
// update position vector
@ -752,8 +753,8 @@
new THREE.Quaternion().setFromRotationMatrix(m4)
);
tab.box.geometry.applyMatrix4(m4);
tab.box.position.x = pos.x = vc.x;
tab.box.position.y = pos.y = vc.y;
tab.box.position.x = pos.x = vc.x - coff.dx;
tab.box.position.y = pos.y = vc.y - coff.dy;
tab.box.position.z = pos.z = vc.z;
});
SPACE.update();