remove extra rotation in linear lathe passes

This commit is contained in:
Stewart Allen 2025-02-16 17:32:30 -05:00
commit 1b28d5e6ed
2 changed files with 3 additions and 3 deletions

View file

@ -497,7 +497,8 @@ kiri.load(() => {
const md = Math.max(Math.abs(dx), Math.abs(dy), Math.abs(dz), dr);
const st = Math.ceil(md / rezstep);
const mx = dx / st, my = dy / st, mz = dz / st;
const sd = Math.sqrt(mx*mx + my*my + mz*mz + dr*dr);
// const sd = Math.sqrt(mx*mx + my*my + mz*mz + dr*dr);
const sd = Math.sqrt(mx*mx + my*my + Math.min(1,mz*mz) + dr*dr);
const moves = [];
for (let i=0, x=lp.x, y=lp.y, z=lp.z; i<st; i++) {
moves.push({x,y,z,a:lp.a,md:sd});

View file

@ -418,8 +418,7 @@ class Topo4 {
recs.forEach((rec,i) => {
const { degrees, heights } = rec;
[...heights].group(3).forEach((a) => {
// progress each path 360 degrees to prevent A rolling backwards
paths[i].camLines[0].push( newPoint(a[0], a[1], a[2] + leave).setA(degrees + i * -360) );
paths[i].camLines[0].push( newPoint(a[0], a[1], a[2] + leave).setA(degrees) );
});
if (i % 2 === 1) {
paths[i].camLines[0].reverse();