From 0b0f24fb16e8d4ac6878b1d1426c22650c369caf Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Mon, 4 Aug 2025 19:32:23 -0400 Subject: [PATCH] fix newSlopeFromAngle in cnc/slice --- src/kiri/mode/cam/slice.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/kiri/mode/cam/slice.js b/src/kiri/mode/cam/slice.js index 3afce49a..6a7dfd71 100644 --- a/src/kiri/mode/cam/slice.js +++ b/src/kiri/mode/cam/slice.js @@ -4,6 +4,7 @@ import { base, util } from '../../../geo/base.js'; import { newLine } from '../../../geo/line.js'; import { newPoint } from '../../../geo/point.js'; import { newPolygon } from '../../../geo/polygon.js'; +import { newSlopeFromAngle } from '../../../geo/slope.js'; import { polygons as POLY } from '../../../geo/polygons.js'; import { setSliceTracker } from '../../core/slice.js'; import { ops as OPS } from './ops.js'; @@ -383,11 +384,11 @@ export function addDogbones(poly, dist, reverse) { let bdiff = ((adiff < 0 ? (180 - adiff) : (180 + adiff)) / 2) + 180; if (!open || (i > 1 && i < length)) { if (isCW && adiff > 45) { - let newa = base.newSlopeFromAngle(lastsl.angle + bdiff); + let newa = newSlopeFromAngle(lastsl.angle + bdiff); newpts.push(lastpt.projectOnSlope(newa, dist)); newpts.push(lastpt.clone()); } else if (!isCW && adiff < -45) { - let newa = base.newSlopeFromAngle(lastsl.angle - bdiff); + let newa = newSlopeFromAngle(lastsl.angle - bdiff); newpts.push(lastpt.projectOnSlope(newa, dist)); newpts.push(lastpt.clone()); }