fixes for indexing and tracking during slicing

This commit is contained in:
Stewart Allen 2022-11-03 10:44:58 -04:00
commit 77c8b0299c
6 changed files with 30 additions and 35 deletions

View file

@ -537,7 +537,7 @@ class Widget {
top = track.top,
tz = tzoff !== top ? -tzoff : 0,
{ x, y, z } = track.pos;
console.trace('ump', {top, tz, tzoff});
// console.trace('ump', {top, tz, tzoff});
if (track.indexed) {
let rad = track.indexRad;
let ln = track.box.d / 2;
@ -658,16 +658,9 @@ class Widget {
// if indexed, return points rotated about X and then offset
let track = this.track;
if (translate && track.indexed) {
// console.log(1, new THREE.Box3().setFromBufferAttribute(pos), track.box);
let delta = track.delta;
pos = pos.clone().applyMatrix4(
new THREE.Matrix4().makeTranslation(0, 0, -track.box.d/2)
).applyMatrix4(
new THREE.Matrix4().makeRotationX(-track.indexRad)
).applyMatrix4(
new THREE.Matrix4().makeTranslation(0, 0, track.box.d/2)
);
// console.log(2, new THREE.Box3().setFromBufferAttribute(pos));
pos = pos.clone()
.applyMatrix4( new THREE.Matrix4().makeRotationX(-track.indexRad) );
}
pos = pos.array;
if (geo.index && unroll !== false) {