From f61a260d1ef540feaf184012edb7cd614fb0e388 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 9 Oct 2026 15:53:36 +0000 Subject: [PATCH 1/7] A dovetail plate at 39.07 mm with a 2.34 mm counterbore builds every piece Every piece with a seam on its left threw in the seam repair and was never built. Two facets of the socket's sloped corner cross the counterbore's ceiling 2 microns from an edge of its own, which leaves three corners just over the weld distance apart, each within it of the line through the other two; the T-junction pass put them into each other's edges until it ran out of passes. When the passes run out, the repair now makes one point of the points it was still putting in that lie within two weld distances of each other, and runs once more. A repair that settles in its passes, which every one did across 1,100 random plates, is unchanged. Audit rows for the plate as filed and the edges of where it threw. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Uqqb1cvhXxrpb3P6y6ykBY --- docs/ENGINE.md | 12 +++++++++ src/core.js | 60 +++++++++++++++++++++++++++++++++++++++------ test/plate-audit.js | 38 ++++++++++++++++++++++++++++ 3 files changed, 103 insertions(+), 7 deletions(-) diff --git a/docs/ENGINE.md b/docs/ENGINE.md index cc15ae4..3e25110 100644 --- a/docs/ENGINE.md +++ b/docs/ENGINE.md @@ -842,3 +842,15 @@ currently installed): a fraction of a micron from a corner and read, to `checkManifold`'s thousandths, as the face's own edges a second time (a puzzle key in the wall from beneath with magnets from above at 42 mm: four edges used four times). Such a face goes out as it is. +- **A weld that never settles is three points, not a loop.** Three cut lines that cross a + face within a couple of microns of one point leave a triangle a couple of microns on a + side there. Each corner is just over `VTOL` from the other two, so the collapse keeps all + three, and each is within `VTOL` of the line through the other two, so the T-junction + pass puts them into each other's edges in turn and never finishes: it threw at six + passes, and forty do no better. When the passes run out, `healCsgSeams` makes one point + of those the last pass was still putting in that lie within two `VTOL` of each other, + and repairs once more from the start; a soup that settles inside the passes never comes + that way. #76 was this: a dovetail plate at 39.07 mm with a 3 mm shank and a 2.34 mm + counterbore, where two facets of the socket's sloped wall at the cell's corner cross the + counterbore's ceiling 2 microns from an edge of its own. Every piece with a seam on its + left failed to build, for heads from 7.3 mm to the cap; 2.339 and 2.341 mm built. diff --git a/src/core.js b/src/core.js index 944947a..0e601c7 100644 --- a/src/core.js +++ b/src/core.js @@ -201,7 +201,7 @@ class BspNode { instrument, not a correctness one, and it was choosing the worse number. */ const VTOL = 2e-3; -function healCsgSeams(polys) { +function healCsgSeams(polys, again) { if (!polys.length) return polys; /* ---- one vertex table for the whole soup, bucketed as it is built ---- @@ -302,16 +302,18 @@ function healCsgSeams(polys) { * * Inserting can expose a further T-junction on a longer edge, hence the loop. Two * passes is the most anything here has needed; the cap is headroom, and it THROWS if - * it is ever reached with work still to do rather than quietly returning a mesh with - * holes in it. Silent partial success is the failure this project keeps rediscovering - * — earTriangulate does it, and it shipped bins with 218 boundary edges. + * it is ever reached with work still to do (after the one more go described where it + * is reached) rather than quietly returning a mesh with holes in it. Silent partial + * success is the failure this project keeps rediscovering — earTriangulate does it, + * and it shipped bins with 218 boundary edges. * * The distance tolerance is VTOL and not something tighter: the collapse above may * just have moved a vertex that far, and a weld that cannot reach it would leave the * T-junction it was meant to close. */ const PASSES = 6; - let pass = 0; + let pass = 0, put = []; // the points this pass put into edges, and the edges' ends for (; pass < PASSES; pass++) { + put = []; /* Count polygon edges, not triangle edges — a fan's diagonals always pair up inside the fan, so the two counts differ only by matched pairs. */ const use = new Map(); @@ -370,7 +372,8 @@ function healCsgSeams(polys) { } if (!hits.length) continue; hits.sort((x, y) => x[0] - y[0]); - for (const [, q] of hits) grown.push(q); + for (const [, q] of hits) { grown.push(q); put.push(q); } + put.push(ia, ib); touched = true; } if (!touched) continue; @@ -378,7 +381,50 @@ function healCsgSeams(polys) { } if (!changed) break; } - if (pass === PASSES) throw new Error('healCsgSeams: T-junctions still appearing after ' + PASSES + ' passes'); + /* Out of passes with the same few points still going into each other's edges. Three cut + lines that cross a face within a couple of microns of one point leave a triangle a + couple of microns on a side there. Each corner is just over VTOL from the other two, + so the collapse keeps all three, and each is within VTOL of the line through the other + two, so this loop puts one corner into the edge between the others, then a second + corner back into the edge that made, and so on for as many passes as it is given. + That was #76, a dovetail plate at 39.07 mm with a 2.34 mm counterbore: two facets of + the socket's sloped wall at the cell's corner, carried down from 5.3 mm by the cell's + tree, cross the counterbore's ceiling 2 microns from an edge of the ceiling's own, and + 40 passes do not settle it any more than 6 do. + + At that size the three corners are one point, and the collapse would have said so + had they been a hair closer: it already makes one point of two that are each within + VTOL of a third, up to two VTOL apart. So the points the last pass was still putting + in, and the ends of the edges it put them in, that lie within two VTOL of each other + become one; every vertex of the input that collapsed onto one of them goes with it; + and the repair runs once more from the start. Only here: a soup that settles inside + the passes, which every one did across 1,100 random plates of every joint and mount, + never comes this way and is repaired exactly as before. A second run that still does + not settle throws, and so does one with nothing close enough to merge. */ + if (pass === PASSES) { + if (!again) { + const ids = [...new Set(put)], up = new Map(ids.map((i) => [i, i])); + const top = (i) => { while (up.get(i) !== i) i = up.get(i); return i; }; + for (let x = 0; x < ids.length; x++) + for (let y = x + 1; y < ids.length; y++) { + const v = verts[ids[x]], w = verts[ids[y]]; + if (Math.hypot(v[0] - w[0], v[1] - w[1], v[2] - w[2]) > 2 * VTOL) continue; + const ra = top(ids[x]), rb = top(ids[y]); + if (ra !== rb) up.set(ra, rb); + } + const size = new Map(); + for (const i of ids) size.set(top(i), (size.get(top(i)) || 0) + 1); + const onto = new Map(); // an input vertex's id -> where it goes + for (let i = 0; i < verts.length; i++) { + const r = find(i); + if (up.has(r) && size.get(top(r)) > 1 && top(r) !== i) onto.set(i, verts[top(r)]); + } + if (onto.size) + return healCsgSeams(polys.map((p) => ({ verts: p.verts.map((v) => onto.get(idOf(v)) || v), + plane: p.plane })), true); + } + throw new Error('healCsgSeams: T-junctions still appearing after ' + PASSES + ' passes'); + } /* Welding creates the other kind of fold. A sliver triangle D-C-B whose corners are nearly collinear really does have its third corner sitting on the opposite edge, so diff --git a/test/plate-audit.js b/test/plate-audit.js index ba25df4..91a72e0 100644 --- a/test/plate-audit.js +++ b/test/plate-audit.js @@ -1437,6 +1437,44 @@ function sectionArea(polys, z, dy) { return area; } +/* #76: a counterbore whose ceiling three cut lines cross at one point. + * + * At 39.07 mm, with a dovetail joint, a 3 mm shank and a counterbore 2.34 mm deep, every + * piece with a seam on its left threw in healCsgSeams and was never built: B1 on the page's + * two-piece plate, B1 to D1 on a four-piece one. Two facets of the socket's sloped wall at + * the cell's corner, carried down by the cell's tree, cross the counterbore's ceiling about + * 2 microns from an edge of the ceiling's own, and the weld's T-junction pass flipped + * between the three corners of the triangle that leaves until it ran out of passes. It + * was a point and not a band: 2.339 and 2.341 mm built, as did 39.06 and 39.08 mm, a + * 2.5 or 3.4 mm shank, and heads up to 7.2 mm; from 7.3 mm to the 9.4 cap every head threw. + * The repair now makes one point of the three and runs again (see healCsgSeams). So the + * plate as filed, the other drawer the issue names, three seams, the smallest head that + * threw and the cap, and the step either side in depth and pitch: every piece built, and + * watertight. */ +console.log('\na counterbore whose ceiling three cut lines cross at one point (#76):'); +{ + const PLATE = { pitch: 39.07, drawerW: 170, drawerD: 90, bedW: 100, bedD: 400, marginMode: 'auto', + connector: 'dovetail', screws: true, screwHoleD: 3, screwHeadDepth: 2.34, screwHeadD: 8 }; + const ROWS = [ + ['as filed: B1 threw', {}], + ['164 mm wide: B1 threw', { drawerW: 164 }], + ['three seams: B1, C1, D1 threw', { drawerW: 280 }], + ['7.3 mm head, the smallest that threw', { screwHeadD: 7.3 }], + ['9.4 mm head, the cap', { screwHeadD: 9.4 }], + ['7.2 mm head', { screwHeadD: 7.2 }], + ['2.33 mm deep', { screwHeadDepth: 2.33 }], + ['2.35 mm deep', { screwHeadDepth: 2.35 }], + ['39.06 mm', { pitch: 39.06 }], + ['39.08 mm', { pitch: 39.08 }], + ]; + for (const [label, over] of ROWS) { + let r = null, err = null; + try { r = buildAll({ ...PLATE, ...over }); } catch (e) { err = e.message; } + console.log(` ${label.padEnd(38)} ${err ? `THREW: ${err}` : `${r.pieces.length} pieces, ${leakText(r)}`}`); + if (err || r.bad) bad++; + } +} + /* A margin of any width beside a corner, square or rounded. * * A margin is a region of its own, cut from the plate's outline beside the cells it runs From 692d78033f998e6b1588a1d8ae77437d687ac294 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 9 Oct 2026 15:53:40 +0000 Subject: [PATCH 2/7] The checks name a piece that failed to build A piece the engine threw on stopped the build and turned Download off, and the piece table and the preview said so, but the checks under the cut map said nothing. They now say which piece could not be built and what usually gets past it, drawn as an error, and the next build clears it. The page test forces a failure for that, since no design is known to throw now, and the plate from #76 is opened and has to build both pieces. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Uqqb1cvhXxrpb3P6y6ykBY --- src/ui.js | 12 +++++++++++- test/ui/plates-robustness.spec.js | 23 ++++++++++++++++++++++- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/src/ui.js b/src/ui.js index 21d5ab1..94720c7 100644 --- a/src/ui.js +++ b/src/ui.js @@ -518,6 +518,16 @@ function warningsList() { // nothing below can — every check after this one is reasoning about the clamped value for (const msg of fieldErrors.values()) out.push({ err: true, stop: true, t: msg }); for (const msg of noRoom.values()) out.push({ err: true, stop: true, t: msg }); + /* A piece the engine threw on. runBuild stops there, and the piece table, the preview and + the Download button's tooltip said so, but the checks, which are where a design is read + for what is wrong with it, said nothing: #76's B1 left Download off with no reason + under the cut map. Drawn as an error but not flagged `err`, which would stop the next + build as well, and the next build, on any change, is what clears it. */ + if (buildFailed) + out.push({ failed: true, t: `Piece ${buildFailed} could not be built, so the build stopped ` + + 'there and the plates cannot be downloaded. That is a fault in this tool rather than in ' + + 'the design: a cut moved through the piece, another joint, or a size changed by a ' + + 'hundredth of a millimetre usually gets past it.' }); if (layout.nx * layout.ny > MAX_CELLS) out.push({ err: true, stop: true, t: `A ${layout.nx} × ${layout.ny} grid is ` + `${layout.nx * layout.ny} cells, past the ${MAX_CELLS} this tool will build in one ` + @@ -669,7 +679,7 @@ function warningsList() { const hasErrors = () => warningsList().some(w => w.err); function drawWarnings() { const ws = warningsList(); - $('warnings').innerHTML = ws.map(w => `
${w.t}
`).join(''); + $('warnings').innerHTML = ws.map(w => `
${w.t}
`).join(''); /* The Download button stops being the primary action when there is nothing behind it. It was enabled through all of this: type -50 into the drawer width and the page said "resolve the errors above to generate" and offered you the download in the diff --git a/test/ui/plates-robustness.spec.js b/test/ui/plates-robustness.spec.js index 0e8ea58..fb56d64 100644 --- a/test/ui/plates-robustness.spec.js +++ b/test/ui/plates-robustness.spec.js @@ -491,7 +491,11 @@ test.describe('the clearance ceiling is the joint\'s and the pitch\'s', () => { }); }); -test('a failed build says so in the table and the dialog, and Download goes off', +/* The checks name the piece as well (#76). The table, the preview and Download's tooltip + said so already, but the list under the cut map, where a design is read for what is + wrong with it, was empty, so Download was off with no reason given there. No design is + known to throw now (the one in #76 builds, below), so the failure is forced. */ +test('a failed build says so in the checks, the table and the dialog, and Download goes off', async ({ page }) => { const pageErrors = []; page.on('pageerror', (e) => pageErrors.push(String(e))); @@ -516,8 +520,11 @@ test('a failed build says so in the table and the dialog, and Download goes off' zipOff: document.querySelector('#exFiles [data-ex="zip"]').disabled, off: document.getElementById('openExport').disabled, failed: buildFailed, + checks: [...document.querySelectorAll('#warnings .w.err')].map((w) => w.textContent), })); expect(s.tail).toMatch(new RegExp(`build failed at piece ${s.failed}`)); + expect(s.checks.join(' '), 'the checks name the piece that failed') + .toMatch(new RegExp(`Piece ${s.failed} could not be built`)); expect(s.rows).toMatch(/failed/); expect(s.fit).toMatch(new RegExp(`Piece ${s.failed} could not be built`)); expect(s.zipOff).toBe(true); @@ -530,6 +537,20 @@ test('a failed build says so in the table and the dialog, and Download goes off' await page.waitForFunction(() => /ready/.test(document.getElementById('pieceTail').textContent), null, { timeout: 30000 }); expect(await exportOff(page)).toBe(false); + expect(await text(page, 'warnings')).not.toMatch(/could not be built/); + }); + +/* #76: B1 of this plate threw in the engine's seam repair (healCsgSeams), so only A1 was + ever listed and Download stayed off. At 2.33 or 2.35 mm it built; plate-audit.js has the + rows either side. */ +test('#76: the 39.07 mm dovetail plate with a 2.34 mm counterbore builds both pieces', + async ({ page }) => { + const errors = await openAt(page, '#pi=39.07&w=170&d=90&bw=100&bd=400&cn=dovetail&sc=1&sh=3&se=2.34&sd=8', + 60000); + expect(await text(page, 'pieceTail')).toMatch(/2 ready/); + expect(await text(page, 'warnings')).not.toMatch(/could not be built/); + expect(await exportOff(page)).toBe(false); + expect(errors).toEqual([]); }); /* ---- #20: spacing on the print plate ---------------------------------------------- */ From 662f1d34aa3d3ec86d3512c113f36405fefd090e Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 9 Oct 2026 15:53:54 +0000 Subject: [PATCH 3/7] Rebuild the pages Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Uqqb1cvhXxrpb3P6y6ykBY --- bins/index.html | 60 ++++++++++++++++++++++++++++++++++++----- index.html | 72 +++++++++++++++++++++++++++++++++++++++++++------ sw.js | 2 +- 3 files changed, 118 insertions(+), 16 deletions(-) diff --git a/bins/index.html b/bins/index.html index b4927b6..cdfda22 100644 --- a/bins/index.html +++ b/bins/index.html @@ -1807,7 +1807,7 @@

Your drawers

instrument, not a correctness one, and it was choosing the worse number. */ const VTOL = 2e-3; -function healCsgSeams(polys) { +function healCsgSeams(polys, again) { if (!polys.length) return polys; /* ---- one vertex table for the whole soup, bucketed as it is built ---- @@ -1908,16 +1908,18 @@

Your drawers

* * Inserting can expose a further T-junction on a longer edge, hence the loop. Two * passes is the most anything here has needed; the cap is headroom, and it THROWS if - * it is ever reached with work still to do rather than quietly returning a mesh with - * holes in it. Silent partial success is the failure this project keeps rediscovering - * — earTriangulate does it, and it shipped bins with 218 boundary edges. + * it is ever reached with work still to do (after the one more go described where it + * is reached) rather than quietly returning a mesh with holes in it. Silent partial + * success is the failure this project keeps rediscovering — earTriangulate does it, + * and it shipped bins with 218 boundary edges. * * The distance tolerance is VTOL and not something tighter: the collapse above may * just have moved a vertex that far, and a weld that cannot reach it would leave the * T-junction it was meant to close. */ const PASSES = 6; - let pass = 0; + let pass = 0, put = []; // the points this pass put into edges, and the edges' ends for (; pass < PASSES; pass++) { + put = []; /* Count polygon edges, not triangle edges — a fan's diagonals always pair up inside the fan, so the two counts differ only by matched pairs. */ const use = new Map(); @@ -1976,7 +1978,8 @@

Your drawers

} if (!hits.length) continue; hits.sort((x, y) => x[0] - y[0]); - for (const [, q] of hits) grown.push(q); + for (const [, q] of hits) { grown.push(q); put.push(q); } + put.push(ia, ib); touched = true; } if (!touched) continue; @@ -1984,7 +1987,50 @@

Your drawers

} if (!changed) break; } - if (pass === PASSES) throw new Error('healCsgSeams: T-junctions still appearing after ' + PASSES + ' passes'); + /* Out of passes with the same few points still going into each other's edges. Three cut + lines that cross a face within a couple of microns of one point leave a triangle a + couple of microns on a side there. Each corner is just over VTOL from the other two, + so the collapse keeps all three, and each is within VTOL of the line through the other + two, so this loop puts one corner into the edge between the others, then a second + corner back into the edge that made, and so on for as many passes as it is given. + That was #76, a dovetail plate at 39.07 mm with a 2.34 mm counterbore: two facets of + the socket's sloped wall at the cell's corner, carried down from 5.3 mm by the cell's + tree, cross the counterbore's ceiling 2 microns from an edge of the ceiling's own, and + 40 passes do not settle it any more than 6 do. + + At that size the three corners are one point, and the collapse would have said so + had they been a hair closer: it already makes one point of two that are each within + VTOL of a third, up to two VTOL apart. So the points the last pass was still putting + in, and the ends of the edges it put them in, that lie within two VTOL of each other + become one; every vertex of the input that collapsed onto one of them goes with it; + and the repair runs once more from the start. Only here: a soup that settles inside + the passes, which every one did across 1,100 random plates of every joint and mount, + never comes this way and is repaired exactly as before. A second run that still does + not settle throws, and so does one with nothing close enough to merge. */ + if (pass === PASSES) { + if (!again) { + const ids = [...new Set(put)], up = new Map(ids.map((i) => [i, i])); + const top = (i) => { while (up.get(i) !== i) i = up.get(i); return i; }; + for (let x = 0; x < ids.length; x++) + for (let y = x + 1; y < ids.length; y++) { + const v = verts[ids[x]], w = verts[ids[y]]; + if (Math.hypot(v[0] - w[0], v[1] - w[1], v[2] - w[2]) > 2 * VTOL) continue; + const ra = top(ids[x]), rb = top(ids[y]); + if (ra !== rb) up.set(ra, rb); + } + const size = new Map(); + for (const i of ids) size.set(top(i), (size.get(top(i)) || 0) + 1); + const onto = new Map(); // an input vertex's id -> where it goes + for (let i = 0; i < verts.length; i++) { + const r = find(i); + if (up.has(r) && size.get(top(r)) > 1 && top(r) !== i) onto.set(i, verts[top(r)]); + } + if (onto.size) + return healCsgSeams(polys.map((p) => ({ verts: p.verts.map((v) => onto.get(idOf(v)) || v), + plane: p.plane })), true); + } + throw new Error('healCsgSeams: T-junctions still appearing after ' + PASSES + ' passes'); + } /* Welding creates the other kind of fold. A sliver triangle D-C-B whose corners are nearly collinear really does have its third corner sitting on the opposite edge, so diff --git a/index.html b/index.html index 20920a6..1425524 100644 --- a/index.html +++ b/index.html @@ -1594,7 +1594,7 @@

Your drawers

instrument, not a correctness one, and it was choosing the worse number. */ const VTOL = 2e-3; -function healCsgSeams(polys) { +function healCsgSeams(polys, again) { if (!polys.length) return polys; /* ---- one vertex table for the whole soup, bucketed as it is built ---- @@ -1695,16 +1695,18 @@

Your drawers

* * Inserting can expose a further T-junction on a longer edge, hence the loop. Two * passes is the most anything here has needed; the cap is headroom, and it THROWS if - * it is ever reached with work still to do rather than quietly returning a mesh with - * holes in it. Silent partial success is the failure this project keeps rediscovering - * — earTriangulate does it, and it shipped bins with 218 boundary edges. + * it is ever reached with work still to do (after the one more go described where it + * is reached) rather than quietly returning a mesh with holes in it. Silent partial + * success is the failure this project keeps rediscovering — earTriangulate does it, + * and it shipped bins with 218 boundary edges. * * The distance tolerance is VTOL and not something tighter: the collapse above may * just have moved a vertex that far, and a weld that cannot reach it would leave the * T-junction it was meant to close. */ const PASSES = 6; - let pass = 0; + let pass = 0, put = []; // the points this pass put into edges, and the edges' ends for (; pass < PASSES; pass++) { + put = []; /* Count polygon edges, not triangle edges — a fan's diagonals always pair up inside the fan, so the two counts differ only by matched pairs. */ const use = new Map(); @@ -1763,7 +1765,8 @@

Your drawers

} if (!hits.length) continue; hits.sort((x, y) => x[0] - y[0]); - for (const [, q] of hits) grown.push(q); + for (const [, q] of hits) { grown.push(q); put.push(q); } + put.push(ia, ib); touched = true; } if (!touched) continue; @@ -1771,7 +1774,50 @@

Your drawers

} if (!changed) break; } - if (pass === PASSES) throw new Error('healCsgSeams: T-junctions still appearing after ' + PASSES + ' passes'); + /* Out of passes with the same few points still going into each other's edges. Three cut + lines that cross a face within a couple of microns of one point leave a triangle a + couple of microns on a side there. Each corner is just over VTOL from the other two, + so the collapse keeps all three, and each is within VTOL of the line through the other + two, so this loop puts one corner into the edge between the others, then a second + corner back into the edge that made, and so on for as many passes as it is given. + That was #76, a dovetail plate at 39.07 mm with a 2.34 mm counterbore: two facets of + the socket's sloped wall at the cell's corner, carried down from 5.3 mm by the cell's + tree, cross the counterbore's ceiling 2 microns from an edge of the ceiling's own, and + 40 passes do not settle it any more than 6 do. + + At that size the three corners are one point, and the collapse would have said so + had they been a hair closer: it already makes one point of two that are each within + VTOL of a third, up to two VTOL apart. So the points the last pass was still putting + in, and the ends of the edges it put them in, that lie within two VTOL of each other + become one; every vertex of the input that collapsed onto one of them goes with it; + and the repair runs once more from the start. Only here: a soup that settles inside + the passes, which every one did across 1,100 random plates of every joint and mount, + never comes this way and is repaired exactly as before. A second run that still does + not settle throws, and so does one with nothing close enough to merge. */ + if (pass === PASSES) { + if (!again) { + const ids = [...new Set(put)], up = new Map(ids.map((i) => [i, i])); + const top = (i) => { while (up.get(i) !== i) i = up.get(i); return i; }; + for (let x = 0; x < ids.length; x++) + for (let y = x + 1; y < ids.length; y++) { + const v = verts[ids[x]], w = verts[ids[y]]; + if (Math.hypot(v[0] - w[0], v[1] - w[1], v[2] - w[2]) > 2 * VTOL) continue; + const ra = top(ids[x]), rb = top(ids[y]); + if (ra !== rb) up.set(ra, rb); + } + const size = new Map(); + for (const i of ids) size.set(top(i), (size.get(top(i)) || 0) + 1); + const onto = new Map(); // an input vertex's id -> where it goes + for (let i = 0; i < verts.length; i++) { + const r = find(i); + if (up.has(r) && size.get(top(r)) > 1 && top(r) !== i) onto.set(i, verts[top(r)]); + } + if (onto.size) + return healCsgSeams(polys.map((p) => ({ verts: p.verts.map((v) => onto.get(idOf(v)) || v), + plane: p.plane })), true); + } + throw new Error('healCsgSeams: T-junctions still appearing after ' + PASSES + ' passes'); + } /* Welding creates the other kind of fold. A sliver triangle D-C-B whose corners are nearly collinear really does have its third corner sitting on the opposite edge, so @@ -7993,6 +8039,16 @@

Your drawers

// nothing below can — every check after this one is reasoning about the clamped value for (const msg of fieldErrors.values()) out.push({ err: true, stop: true, t: msg }); for (const msg of noRoom.values()) out.push({ err: true, stop: true, t: msg }); + /* A piece the engine threw on. runBuild stops there, and the piece table, the preview and + the Download button's tooltip said so, but the checks, which are where a design is read + for what is wrong with it, said nothing: #76's B1 left Download off with no reason + under the cut map. Drawn as an error but not flagged `err`, which would stop the next + build as well, and the next build, on any change, is what clears it. */ + if (buildFailed) + out.push({ failed: true, t: `Piece ${buildFailed} could not be built, so the build stopped ` + + 'there and the plates cannot be downloaded. That is a fault in this tool rather than in ' + + 'the design: a cut moved through the piece, another joint, or a size changed by a ' + + 'hundredth of a millimetre usually gets past it.' }); if (layout.nx * layout.ny > MAX_CELLS) out.push({ err: true, stop: true, t: `A ${layout.nx} × ${layout.ny} grid is ` + `${layout.nx * layout.ny} cells, past the ${MAX_CELLS} this tool will build in one ` + @@ -8144,7 +8200,7 @@

Your drawers

const hasErrors = () => warningsList().some(w => w.err); function drawWarnings() { const ws = warningsList(); - $('warnings').innerHTML = ws.map(w => `
${w.t}
`).join(''); + $('warnings').innerHTML = ws.map(w => `
${w.t}
`).join(''); /* The Download button stops being the primary action when there is nothing behind it. It was enabled through all of this: type -50 into the drawer width and the page said "resolve the errors above to generate" and offered you the download in the diff --git a/sw.js b/sw.js index 3af8f97..151d03c 100644 --- a/sw.js +++ b/sw.js @@ -52,7 +52,7 @@ load from this site, and the app's icons and manifest, as paths from the root. VERSION is a hash of all of those files, names and bytes, and of this script as it is served, FILES filled in and everything else but VERSION itself. */ -const VERSION = "d4d7bc3b8d8c"; +const VERSION = "a3358172a0ef"; const FILES = [ "./", "bins/", From 04755cd9d7e14078150f48dd07b720c50d85176a Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 9 Oct 2026 17:13:51 +0000 Subject: [PATCH 4/7] A plate whose seam repair settles open after the merge fails to build as before The merge #76 added ran the repair once more and returned whatever that came to. A jigsaw plate at 41.24 mm with magnets from above and a 3.126 mm counterbore runs out of passes on both pieces, and the second run settles with edges open: the page built A1 and B1 with 55 bad edges each and Download on, where main fails A1 and says so. With a 2.264 mm magnet the pieces came out closed but folded, with NaN normals in the STL. The second run is now kept only if it comes out closed; otherwise it throws as before. plate-audit.js holds that plate and its 2.264 mm variant to "threw in the seam repair, or watertight and oriented", built as the page builds them, and the #76 rows are now checked for orientation as well as leaks. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Uqqb1cvhXxrpb3P6y6ykBY --- docs/ENGINE.md | 5 ++++- src/core.js | 25 +++++++++++++++++++------ test/plate-audit.js | 40 ++++++++++++++++++++++++++++++++++------ 3 files changed, 57 insertions(+), 13 deletions(-) diff --git a/docs/ENGINE.md b/docs/ENGINE.md index 3e25110..4072c14 100644 --- a/docs/ENGINE.md +++ b/docs/ENGINE.md @@ -853,4 +853,7 @@ currently installed): that way. #76 was this: a dovetail plate at 39.07 mm with a 3 mm shank and a 2.34 mm counterbore, where two facets of the socket's sloped wall at the cell's corner cross the counterbore's ceiling 2 microns from an edge of its own. Every piece with a seam on its - left failed to build, for heads from 7.3 mm to the cap; 2.339 and 2.341 mm built. + left failed to build, for heads from 7.3 mm to the cap; 2.339 and 2.341 mm built. The + second run is kept only if it comes out closed: a jigsaw plate at 41.24 mm with magnets + from above settles open after the merge, and fails to build as it did before rather + than going out with holes. diff --git a/src/core.js b/src/core.js index 0e601c7..61732a4 100644 --- a/src/core.js +++ b/src/core.js @@ -398,9 +398,20 @@ function healCsgSeams(polys, again) { in, and the ends of the edges it put them in, that lie within two VTOL of each other become one; every vertex of the input that collapsed onto one of them goes with it; and the repair runs once more from the start. Only here: a soup that settles inside - the passes, which every one did across 1,100 random plates of every joint and mount, - never comes this way and is repaired exactly as before. A second run that still does - not settle throws, and so does one with nothing close enough to merge. */ + the passes never comes this way and is repaired exactly as before. That is nearly + every soup, but not every one. None of 1,100 random plates of every joint and mount + ran out; the turned cutters of a cell cut again do on a few engine-only cells (see + the fastener cut in buildPiece), and so does a jigsaw plate at 41.24 mm with magnets + from above and a 3.126 mm counterbore, on the first cut of both its pieces. + + The second run is kept only if it comes out closed, and that jigsaw plate is why. + The merge lets its repair settle, but open, and returned that was 55 bad edges on + each piece with Download on, where before the same pieces failed to build and the + page said so; with a 2.264 mm magnet the cut was open by four edges and the piece + came out closed but folded. So a second run that does not settle throws, as does one + that settles open, or one with nothing close enough to merge. Faces it turned over + are no reason to throw: #76 with an 8.3 mm head turns six and builds watertight, + every shell facing outwards. */ if (pass === PASSES) { if (!again) { const ids = [...new Set(put)], up = new Map(ids.map((i) => [i, i])); @@ -419,9 +430,11 @@ function healCsgSeams(polys, again) { const r = find(i); if (up.has(r) && size.get(top(r)) > 1 && top(r) !== i) onto.set(i, verts[top(r)]); } - if (onto.size) - return healCsgSeams(polys.map((p) => ({ verts: p.verts.map((v) => onto.get(idOf(v)) || v), - plane: p.plane })), true); + if (onto.size) { + const res = healCsgSeams(polys.map((p) => ({ verts: p.verts.map((v) => onto.get(idOf(v)) || v), + plane: p.plane })), true); + if (!res.open) return res; // open, it fails as it did before the merge + } } throw new Error('healCsgSeams: T-junctions still appearing after ' + PASSES + ' passes'); } diff --git a/test/plate-audit.js b/test/plate-audit.js index 91a72e0..0e21ebb 100644 --- a/test/plate-audit.js +++ b/test/plate-audit.js @@ -1449,8 +1449,19 @@ function sectionArea(polys, z, dy) { * 2.5 or 3.4 mm shank, and heads up to 7.2 mm; from 7.3 mm to the 9.4 cap every head threw. * The repair now makes one point of the three and runs again (see healCsgSeams). So the * plate as filed, the other drawer the issue names, three seams, the smallest head that - * threw and the cap, and the step either side in depth and pitch: every piece built, and - * watertight. */ + * threw and the cap, and the step either side in depth and pitch: every piece built, + * watertight, and with every shell facing outwards. The last is asked as well as the edge + * count because a merge can close a hole with a fold. + * + * And where the merge does not help. A jigsaw plate at 41.24 mm, with magnets from above + * and a counterbore 3.126 mm deep under a 7.504 mm head, runs out of passes on the first + * cut of both its pieces, and threw there before the merge. The merge lets that repair + * settle, but open; kept as it came, the page built both pieces with 55 bad edges and + * Download on, and with the magnet 2.264 mm deep, closed but folded twice, with NaN normals + * in the STL. A second run that comes out open throws now, so the plate fails to build, as + * it did before, and the checks say so. These two rows are built as the page builds them + * (its clearances and margins), and hold "threw in the seam repair, or watertight and + * oriented": whatever builds them later has to build them whole. */ console.log('\na counterbore whose ceiling three cut lines cross at one point (#76):'); { const PLATE = { pitch: 39.07, drawerW: 170, drawerD: 90, bedW: 100, bedD: 400, marginMode: 'auto', @@ -1467,11 +1478,28 @@ console.log('\na counterbore whose ceiling three cut lines cross at one point (# ['39.06 mm', { pitch: 39.06 }], ['39.08 mm', { pitch: 39.08 }], ]; - for (const [label, over] of ROWS) { + const build = (over) => { let r = null, err = null; - try { r = buildAll({ ...PLATE, ...over }); } catch (e) { err = e.message; } - console.log(` ${label.padEnd(38)} ${err ? `THREW: ${err}` : `${r.pieces.length} pieces, ${leakText(r)}`}`); - if (err || r.bad) bad++; + try { r = buildAll(over); } catch (e) { err = e.message; } + const turned = r ? r.pieces.map(checkOrientation).filter((o) => !o.ok) : []; + const text = err ? `THREW: ${err}` : `${r.pieces.length} pieces, ${leakText(r)}, ` + + (turned.length ? `${turned.length} pieces: ${orientationNote(turned[0])}` : 'oriented'); + return { r, err, whole: r && !r.bad && !turned.length, text }; + }; + for (const [label, over] of ROWS) { + const b = build({ ...PLATE, ...over }); + console.log(` ${label.padEnd(38)} ${b.text}`); + if (!b.whole) bad++; + } + const JIGSAW = { pitch: 41.24, drawerW: 84.79, drawerD: 60.96, bedW: 53.61, bedD: 400, marginMode: 'auto', + connector: 'puzzle', clr: 0.2, screws: true, screwHoleD: 3, screwHeadDepth: 3.126, + screwHeadD: 7.504, magnets: true, magnetSide: 'top', magnetD: 7.3, magnetH: 2.25 }; + for (const [label, over] of [['41.24 mm jigsaw: 55 bad edges a piece', {}], + ['2.264 mm magnet: folded twice', { magnetH: 2.264 }]]) { + const b = build({ ...JIGSAW, ...over }); + const held = b.whole || /^healCsgSeams/.test(b.err || ''); + console.log(` ${label.padEnd(38)} ${b.text}${held ? '' : ' NEITHER THREW NOR BUILT WHOLE'}`); + if (!held) bad++; } } From a153cdd89dd7a9a2f1cbe344fc1667235e65af18 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 9 Oct 2026 17:14:31 +0000 Subject: [PATCH 5/7] The checks say Download is off when a piece fails, and promise no size that gets past it "The plates cannot be downloaded" overstated it: the pieces built before the one that failed keep their own STL buttons in the piece table. And "a size changed by a hundredth of a millimetre usually gets past it" can send someone to a size that builds with holes: the 41.24 mm jigsaw plate fails with a 7.504 mm head and builds with 57 bad edges a piece at 7.502 mm, on main too. The forced-failure spec's comment said no design was known to throw; that jigsaw plate does again, and the spec now reads the new wording. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Uqqb1cvhXxrpb3P6y6ykBY --- src/ui.js | 11 +++++++---- test/ui/plates-robustness.spec.js | 8 ++++++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/ui.js b/src/ui.js index 94720c7..23ac4d9 100644 --- a/src/ui.js +++ b/src/ui.js @@ -522,12 +522,15 @@ function warningsList() { the Download button's tooltip said so, but the checks, which are where a design is read for what is wrong with it, said nothing: #76's B1 left Download off with no reason under the cut map. Drawn as an error but not flagged `err`, which would stop the next - build as well, and the next build, on any change, is what clears it. */ + build as well, and the next build, on any change, is what clears it. It says Download + is off, not that nothing can be downloaded: the pieces built before it keep their own + STL buttons in the piece table. And it promises no size that gets past it: the 41.24 mm + jigsaw plate in plate-audit.js fails with a 7.504 mm head and builds with holes at + 7.502 mm, on main as well. */ if (buildFailed) out.push({ failed: true, t: `Piece ${buildFailed} could not be built, so the build stopped ` + - 'there and the plates cannot be downloaded. That is a fault in this tool rather than in ' + - 'the design: a cut moved through the piece, another joint, or a size changed by a ' + - 'hundredth of a millimetre usually gets past it.' }); + 'there and Download is off. That is a fault in this tool, not in the design; moving a cut ' + + 'through the piece or picking another joint may get past it.' }); if (layout.nx * layout.ny > MAX_CELLS) out.push({ err: true, stop: true, t: `A ${layout.nx} × ${layout.ny} grid is ` + `${layout.nx * layout.ny} cells, past the ${MAX_CELLS} this tool will build in one ` + diff --git a/test/ui/plates-robustness.spec.js b/test/ui/plates-robustness.spec.js index fb56d64..7ee84cf 100644 --- a/test/ui/plates-robustness.spec.js +++ b/test/ui/plates-robustness.spec.js @@ -493,8 +493,10 @@ test.describe('the clearance ceiling is the joint\'s and the pitch\'s', () => { /* The checks name the piece as well (#76). The table, the preview and Download's tooltip said so already, but the list under the cut map, where a design is read for what is - wrong with it, was empty, so Download was off with no reason given there. No design is - known to throw now (the one in #76 builds, below), so the failure is forced. */ + wrong with it, was empty, so Download was off with no reason given there. The failure is + forced rather than taken from a design that fails, which would tie this test to an engine + bug a later fix should remove: #76's plate builds now (below), and the 41.24 mm jigsaw + plate in plate-audit.js still fails in the seam repair, as it does on main. */ test('a failed build says so in the checks, the table and the dialog, and Download goes off', async ({ page }) => { const pageErrors = []; @@ -525,6 +527,8 @@ test('a failed build says so in the checks, the table and the dialog, and Downlo expect(s.tail).toMatch(new RegExp(`build failed at piece ${s.failed}`)); expect(s.checks.join(' '), 'the checks name the piece that failed') .toMatch(new RegExp(`Piece ${s.failed} could not be built`)); + // Download, not every file: the pieces built before it keep their own STL buttons + expect(s.checks.join(' ')).toMatch(/Download is off/); expect(s.rows).toMatch(/failed/); expect(s.fit).toMatch(new RegExp(`Piece ${s.failed} could not be built`)); expect(s.zipOff).toBe(true); From d1f6bc2b8a591d31c3682078029daf8efe7b3611 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 9 Oct 2026 17:17:00 +0000 Subject: [PATCH 6/7] Say where a retry that used to throw is now kept Before #76's merge, the turned cutters of a cell cut again threw at healCsgSeams' pass limit on a few engine-only cells, the build passed the throw over, and the nudged try after it closed the cell. Now that try can settle after the merge, come back closed, and be kept, so "same bytes unless it threw" holds per cut, not per piece. The audit's "a retry that throws" is that case: the limit is reached ten times over its five pieces, every piece's bytes change, and every piece is still watertight and oriented. Its comment and the fastener cut's now say so, and that no audit row reaches the catch any more (traced over the whole audit: 19 merges, 2 throws, neither passed over). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Uqqb1cvhXxrpb3P6y6ykBY --- src/core.js | 11 ++++++++--- test/plate-audit.js | 15 ++++++++++----- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/core.js b/src/core.js index 61732a4..fbbb341 100644 --- a/src/core.js +++ b/src/core.js @@ -3608,9 +3608,14 @@ function buildPiece(cfg, layout, piece, onStatus) { screw head to sit against; a nudge moves every plane off the crossing that lost the sliver. The first closed result is kept; a cell that comes out closed first time, which is nearly every one, is - built exactly as before. A try that throws (healCsgSeams' T-junction pass limit, - which the turned cutters reach on a few engine-only cells) is passed over and - the first cut stands, open as it was rather than a failed build. + built exactly as before. A try that throws is passed over and the first cut + stands, open as it was rather than a failed build. The turned cutters reach + healCsgSeams' T-junction pass limit on a few engine-only cells, and they threw + there until #76; now the repair makes one point of the few it was still + putting into edges and runs once more, so such a try can come back closed and + be kept where the nudged one after it used to be (the audit's "a retry that + throws": every piece's bytes change, and every piece is still watertight). One + whose second run comes out open still throws, and is passed over. Only a cell open by a sliver or a few is cut again, at most 24 edges: six at each of its four pockets. Cells cut again have been open by anything from 1 to diff --git a/test/plate-audit.js b/test/plate-audit.js index 0e21ebb..70873cf 100644 --- a/test/plate-audit.js +++ b/test/plate-audit.js @@ -327,11 +327,16 @@ const CASES = [ tab: { ...G.DEFAULTS.tab, clr: 0.98 }, puzzle: { ...G.DEFAULTS.puzzle, clr: 0.98 }, key: { ...G.DEFAULTS.key, clr: 0.93 }, hclip: { ...G.DEFAULTS.hclip, clr: 0.93 } }, /* A cell whose pockets come out open is cut again (see the fastener cut in buildPiece), - and here the turned cutters' cut throws: healCsgSeams' T-junction pass limit. Taken - unguarded, that one try made the whole plate fail to build, where main builds it open. - The throw is passed over, and the cutters nudged 1.7 microns, the try after it, close - every cell left open here (3 to 9 edges a piece; main has 9 and folds on every piece). - Engine-only again: the sites 2.5 mm in, at 15.5 mm. */ + and here the turned cutters' cut reaches healCsgSeams' T-junction pass limit, ten + times over the five pieces. Taken unguarded, that one try made the whole plate fail to + build, where main builds it open. Until #76 it threw there: the throw was passed over, + and the cutters nudged 1.7 microns, the try after it, closed every cell left open here + (3 to 9 edges a piece; main has 9 and folds on every piece). Now the repair makes one + point of those it was still putting into edges and settles, closed, so the turned try + is kept itself: every piece's bytes change, and every piece is still watertight and + oriented. So the row is named for what it was found as: it no longer reaches the catch + that passes over a try that throws, and no row here does. Engine-only again: the + sites 2.5 mm in, at 15.5 mm. */ { name: 'a retry that throws', pitch: 15.5, drawerW: 3 * 15.5, drawerD: 5 * 15.5, bedW: 400, bedD: 400, splitMode: 'manual', rowCuts: [1, 2], colCuts: [[], [], [1, 2]], connector: 'snap', keyType: 'snap', keyInsert: 'top', magnets: true, screws: true, From ed7cd1205149dc32973b3d07d299d7484033e848 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 9 Oct 2026 17:17:08 +0000 Subject: [PATCH 7/7] Rebuild the pages Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Uqqb1cvhXxrpb3P6y6ykBY --- bins/index.html | 36 +++++++++++++++++++++++++++--------- index.html | 47 ++++++++++++++++++++++++++++++++++------------- sw.js | 2 +- 3 files changed, 62 insertions(+), 23 deletions(-) diff --git a/bins/index.html b/bins/index.html index cdfda22..b1583e1 100644 --- a/bins/index.html +++ b/bins/index.html @@ -2004,9 +2004,20 @@

Your drawers

in, and the ends of the edges it put them in, that lie within two VTOL of each other become one; every vertex of the input that collapsed onto one of them goes with it; and the repair runs once more from the start. Only here: a soup that settles inside - the passes, which every one did across 1,100 random plates of every joint and mount, - never comes this way and is repaired exactly as before. A second run that still does - not settle throws, and so does one with nothing close enough to merge. */ + the passes never comes this way and is repaired exactly as before. That is nearly + every soup, but not every one. None of 1,100 random plates of every joint and mount + ran out; the turned cutters of a cell cut again do on a few engine-only cells (see + the fastener cut in buildPiece), and so does a jigsaw plate at 41.24 mm with magnets + from above and a 3.126 mm counterbore, on the first cut of both its pieces. + + The second run is kept only if it comes out closed, and that jigsaw plate is why. + The merge lets its repair settle, but open, and returned that was 55 bad edges on + each piece with Download on, where before the same pieces failed to build and the + page said so; with a 2.264 mm magnet the cut was open by four edges and the piece + came out closed but folded. So a second run that does not settle throws, as does one + that settles open, or one with nothing close enough to merge. Faces it turned over + are no reason to throw: #76 with an 8.3 mm head turns six and builds watertight, + every shell facing outwards. */ if (pass === PASSES) { if (!again) { const ids = [...new Set(put)], up = new Map(ids.map((i) => [i, i])); @@ -2025,9 +2036,11 @@

Your drawers

const r = find(i); if (up.has(r) && size.get(top(r)) > 1 && top(r) !== i) onto.set(i, verts[top(r)]); } - if (onto.size) - return healCsgSeams(polys.map((p) => ({ verts: p.verts.map((v) => onto.get(idOf(v)) || v), - plane: p.plane })), true); + if (onto.size) { + const res = healCsgSeams(polys.map((p) => ({ verts: p.verts.map((v) => onto.get(idOf(v)) || v), + plane: p.plane })), true); + if (!res.open) return res; // open, it fails as it did before the merge + } } throw new Error('healCsgSeams: T-junctions still appearing after ' + PASSES + ' passes'); } @@ -5201,9 +5214,14 @@

Your drawers

screw head to sit against; a nudge moves every plane off the crossing that lost the sliver. The first closed result is kept; a cell that comes out closed first time, which is nearly every one, is - built exactly as before. A try that throws (healCsgSeams' T-junction pass limit, - which the turned cutters reach on a few engine-only cells) is passed over and - the first cut stands, open as it was rather than a failed build. + built exactly as before. A try that throws is passed over and the first cut + stands, open as it was rather than a failed build. The turned cutters reach + healCsgSeams' T-junction pass limit on a few engine-only cells, and they threw + there until #76; now the repair makes one point of the few it was still + putting into edges and runs once more, so such a try can come back closed and + be kept where the nudged one after it used to be (the audit's "a retry that + throws": every piece's bytes change, and every piece is still watertight). One + whose second run comes out open still throws, and is passed over. Only a cell open by a sliver or a few is cut again, at most 24 edges: six at each of its four pockets. Cells cut again have been open by anything from 1 to diff --git a/index.html b/index.html index 1425524..2a876bf 100644 --- a/index.html +++ b/index.html @@ -1791,9 +1791,20 @@

Your drawers

in, and the ends of the edges it put them in, that lie within two VTOL of each other become one; every vertex of the input that collapsed onto one of them goes with it; and the repair runs once more from the start. Only here: a soup that settles inside - the passes, which every one did across 1,100 random plates of every joint and mount, - never comes this way and is repaired exactly as before. A second run that still does - not settle throws, and so does one with nothing close enough to merge. */ + the passes never comes this way and is repaired exactly as before. That is nearly + every soup, but not every one. None of 1,100 random plates of every joint and mount + ran out; the turned cutters of a cell cut again do on a few engine-only cells (see + the fastener cut in buildPiece), and so does a jigsaw plate at 41.24 mm with magnets + from above and a 3.126 mm counterbore, on the first cut of both its pieces. + + The second run is kept only if it comes out closed, and that jigsaw plate is why. + The merge lets its repair settle, but open, and returned that was 55 bad edges on + each piece with Download on, where before the same pieces failed to build and the + page said so; with a 2.264 mm magnet the cut was open by four edges and the piece + came out closed but folded. So a second run that does not settle throws, as does one + that settles open, or one with nothing close enough to merge. Faces it turned over + are no reason to throw: #76 with an 8.3 mm head turns six and builds watertight, + every shell facing outwards. */ if (pass === PASSES) { if (!again) { const ids = [...new Set(put)], up = new Map(ids.map((i) => [i, i])); @@ -1812,9 +1823,11 @@

Your drawers

const r = find(i); if (up.has(r) && size.get(top(r)) > 1 && top(r) !== i) onto.set(i, verts[top(r)]); } - if (onto.size) - return healCsgSeams(polys.map((p) => ({ verts: p.verts.map((v) => onto.get(idOf(v)) || v), - plane: p.plane })), true); + if (onto.size) { + const res = healCsgSeams(polys.map((p) => ({ verts: p.verts.map((v) => onto.get(idOf(v)) || v), + plane: p.plane })), true); + if (!res.open) return res; // open, it fails as it did before the merge + } } throw new Error('healCsgSeams: T-junctions still appearing after ' + PASSES + ' passes'); } @@ -4988,9 +5001,14 @@

Your drawers

screw head to sit against; a nudge moves every plane off the crossing that lost the sliver. The first closed result is kept; a cell that comes out closed first time, which is nearly every one, is - built exactly as before. A try that throws (healCsgSeams' T-junction pass limit, - which the turned cutters reach on a few engine-only cells) is passed over and - the first cut stands, open as it was rather than a failed build. + built exactly as before. A try that throws is passed over and the first cut + stands, open as it was rather than a failed build. The turned cutters reach + healCsgSeams' T-junction pass limit on a few engine-only cells, and they threw + there until #76; now the repair makes one point of the few it was still + putting into edges and runs once more, so such a try can come back closed and + be kept where the nudged one after it used to be (the audit's "a retry that + throws": every piece's bytes change, and every piece is still watertight). One + whose second run comes out open still throws, and is passed over. Only a cell open by a sliver or a few is cut again, at most 24 edges: six at each of its four pockets. Cells cut again have been open by anything from 1 to @@ -8043,12 +8061,15 @@

Your drawers

the Download button's tooltip said so, but the checks, which are where a design is read for what is wrong with it, said nothing: #76's B1 left Download off with no reason under the cut map. Drawn as an error but not flagged `err`, which would stop the next - build as well, and the next build, on any change, is what clears it. */ + build as well, and the next build, on any change, is what clears it. It says Download + is off, not that nothing can be downloaded: the pieces built before it keep their own + STL buttons in the piece table. And it promises no size that gets past it: the 41.24 mm + jigsaw plate in plate-audit.js fails with a 7.504 mm head and builds with holes at + 7.502 mm, on main as well. */ if (buildFailed) out.push({ failed: true, t: `Piece ${buildFailed} could not be built, so the build stopped ` + - 'there and the plates cannot be downloaded. That is a fault in this tool rather than in ' + - 'the design: a cut moved through the piece, another joint, or a size changed by a ' + - 'hundredth of a millimetre usually gets past it.' }); + 'there and Download is off. That is a fault in this tool, not in the design; moving a cut ' + + 'through the piece or picking another joint may get past it.' }); if (layout.nx * layout.ny > MAX_CELLS) out.push({ err: true, stop: true, t: `A ${layout.nx} × ${layout.ny} grid is ` + `${layout.nx * layout.ny} cells, past the ${MAX_CELLS} this tool will build in one ` + diff --git a/sw.js b/sw.js index 151d03c..487f1bf 100644 --- a/sw.js +++ b/sw.js @@ -52,7 +52,7 @@ load from this site, and the app's icons and manifest, as paths from the root. VERSION is a hash of all of those files, names and bytes, and of this script as it is served, FILES filled in and everything else but VERSION itself. */ -const VERSION = "a3358172a0ef"; +const VERSION = "87e3541175b2"; const FILES = [ "./", "bins/",