diff --git a/src/kiri/mode/fdm/post.js b/src/kiri/mode/fdm/post.js index d3a19198..1554ad4d 100644 --- a/src/kiri/mode/fdm/post.js +++ b/src/kiri/mode/fdm/post.js @@ -183,11 +183,11 @@ function thin_type_3(params) { let mergeChains = true; let interpolateShortSpur = true; let showChainRawPoints = false; - let showChainInterpPoints = true; + let showChainInterpPoints = false; let showMidline = true; let showMidPoints = true; let showMidNormals = true; - let showMidRadii = true; + let showMidRadii = false; let showNexuses = false; let pointMap = new Map(); @@ -481,6 +481,29 @@ function thin_type_3(params) { top.shells.push(newPolygon().centerCircle(point, 0.2, 6 - rec.shorts)); } + function renderPointNormal(pt, ndx, ndy) { + if (showMidNormals) { + let xo = ndx * pt.r; + let yo = ndy * pt.r; + thin.push(new Point(pt.x + yo, pt.y - xo)); + thin.push(new Point(pt.x - yo, pt.y + xo)); + } + if (showMidRadii) { + const Sx = pt.x + ndy * pt.r; + const Sy = pt.y - ndx * pt.r; + const circ = top.shells; + const pop = div(pt.r); + let acc = 0; + for (let r of pop) { + const t = acc + r; + const px = Sx + -ndy * t; + const py = Sy + ndx * t; + circ.push(newPolygon().centerCircle({x:px, y:py}, r, 10)); + acc += r * 2; + } + } +} + // gather point offsets into shells let zi = z; for (let chain of chains) { @@ -510,7 +533,7 @@ function thin_type_3(params) { let dy = (p1.y - p0.y); let ndx = dx / len; let ndy = dy / len; - segs.push({ p0, p1, len, offs, step, dr, dx, dy, ndx, ndy }); + segs.push({ p0, p1, offs, step, dr, dx, dy, ndx, ndy }); } console.log({ segs }); // compute chain subdivisions @@ -518,7 +541,7 @@ function thin_type_3(params) { for (let si=0; si