From 7655528b951d8beccf244198122ccf03cad3e447 Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Tue, 17 Jan 2023 06:41:37 -0500 Subject: [PATCH] fix delta segment calc --- src/kiri-mode/cam/topo4.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/kiri-mode/cam/topo4.js b/src/kiri-mode/cam/topo4.js index fcab1ab4..5cabfb5c 100644 --- a/src/kiri-mode/cam/topo4.js +++ b/src/kiri-mode/cam/topo4.js @@ -214,15 +214,15 @@ class Topo4 { const plen = lines.length; for (let i = 0; i < plen; ) { ++i; // skip x which should match slice.z - const py0 = lines[i++]; + let py0 = lines[i++]; const pz0 = lines[i++]; ++i; // skip x which should match slice.z - const py1 = lines[i++]; + let py1 = lines[i++]; const pz1 = lines[i++]; if ((py0 <= yo && py1 >= yo) || (py1 <= yo && py0 >= yo)) { - const dz = Math.abs(pz0 - pz1); + const dz = pz1 - pz0; const dy = Math.abs(py1 - py0); - const fr = (yo - py0) / dy; + const fr = Math.abs(yo - py0) / dy; const lz = pz0 + dz * fr + zo; // check z height mz = Math.max(mz, lz);