From fee09c17f57b79270c2a0c436d064e830d7f8c92 Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Fri, 19 Jul 2024 20:37:32 -0400 Subject: [PATCH] gear generation remembers previous settings and uses them as defaults --- src/geo/polygon.js | 7 +++++-- src/mesh/api.js | 22 +++++++++++++--------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/geo/polygon.js b/src/geo/polygon.js index d10177cd..8f517734 100644 --- a/src/geo/polygon.js +++ b/src/geo/polygon.js @@ -2050,7 +2050,8 @@ class Polygon { // for turning a poly with an inner offset into a // 3d mesh if and only if the inner has the same - // circularity and <= num points. used to make chamfers + // circularity and <= num points + // primarily used to make chamfers ribbonMesh(swap) { if (!(this.inner && this.inner.length === 1)) { return undefined; @@ -2064,6 +2065,7 @@ class Polygon { let p0 = outer.points.slice(); let p1 = inner.points.slice(); let min = { d: Infinity, i:0, j:0 }; + // find the closests two points inner/outer for (let i=0; i