diff --git a/bins/index.html b/bins/index.html index 9013b61..8643b9b 100644 --- a/bins/index.html +++ b/bins/index.html @@ -6190,11 +6190,62 @@

Your drawers

const own = [b[0], b[1], b[3], b[4]]; const beside = cutCells.filter((c) => c.box[0] < own[2] && own[0] < c.box[2] && c.box[1] < own[3] && own[1] < c.box[3]); - let r = cutAgain(shells[i], cut, csgSubtract(shells[i], cut)); + let solid = shells[i], r = cutAgain(solid, cut, csgSubtract(solid, cut)); + /* A whole cell whose housing still comes out open after every way cutAgain takes it + has its mounting pockets cut again, the ways settle cuts them again (pocketTries: + moved 1.7 microns one way along a diagonal or the other, turned a 28th of a turn, + or both), and the housing out of each, as cutAgain takes it. The first that comes + out closed with nothing turned over, and sharing no more edges with the shells + beside it than the first cut did, is kept (#85). + * + Nothing of a pocket reaches the housing over a solid floor (mountLimits): at 34.5 + mm a magnet from beneath stops 2.2 mm under an H-clip's cup and 2.1 under a snap + clip's slot. The pocket's planes reach it. Its cut, carried across the cell by the + BSP, splits the cell's faces where its planes cross them, and the weld in + healCsgSeams can move a split a few microns off its face's plane; the cell comes + out closed, and the housing, cut out of it afterwards, crosses that face. A 6.3 mm + magnet at 34.5 mm, its cap there, with an H-clip or a snap clip put in from above: + the flat of the pocket nearest the junction crosses the side of the cell's region + that stands a BLOAT inside the cell in front 0.019 mm from the seam face, beside + the corner the region's top face is fanned from. The spokes are microns apart + there, and the weld, which chains, joined the side's top corner to where the flat + crosses the second spoke, 3.4 microns off the side's plane. The cavity's end wall, + 2.5 mm in from the seam (2.83 for the snap clip), crosses the triangle the side has + up to that corner: the wall stops on the side's plane, the side split along the + wall stands 1.9 microns off it where the wall meets the triangle's lower edge and + 2.5 at the plate's top (the H-clip's), and the weld, VTOL wide, joins the one end + and not the other. A1 shipped 4 open edges, 3 with the snap clip, with Download + on. Moving the housing, as cutAgain does, leaves the side as it is; cutting the + pockets again moves the flat off the corner. It is not the cap: the sizes that + came out open follow that flat, within 0.02 mm of the corner from a 6.3 mm magnet + at 34.5 mm to 15 mm at 46, cap or not, and a pocket's planes can fall as badly + elsewhere, a 6.25 mm magnet at 37.5 mm leaving 14 edges where the cavity's walls + cross the socket's corner facets the planes had split. Of 38,013 designs the field + takes, swept from 30 to 46 mm (the H-clip and both snap clips put in from above or + beneath, wall keys from above, a solid floor or corner bosses), 176 came out open, + every one with its joint put in from above, and all of them come out closed now. + * + A cell whose housing comes out closed first time, nearly every one, is built as + before, and so is one that comes out closed with a face turned over: two such, + snap clips at 44.5 mm with an 11.1 mm magnet, fold nothing in the finished piece, + and cutting the pockets again would only have given them other bytes. */ + const cell = r.open && mountCells.find((c) => c.i === i && c.recut); + if (cell) { + const near = builtBeside(cell.box).filter((c) => c !== cell), shares = sharedAll(r, cell.box, near); + for (let k = 0; k < POCKET_TRIES; k++) { + let pockets, again; + try { pockets = cell.recut(cell.alt, k); } catch (e) { continue; } + if (!pockets || pockets.open || pockets.turned) continue; + try { again = cutAgain(pockets, cut, csgSubtract(pockets, cut)); } catch (e) { continue; } + if (again.open || again.turned || sharedAll(again, cell.box, near) > shares) continue; + solid = pockets; r = again; cell.pocket = k; + break; + } + } if (beside.some((c) => touchesBuilt(r, own, c))) for (const alt of TOUCH_TRIES) { let again; - try { again = alt(shells[i], cut); } catch (e) { continue; } + try { again = alt(solid, cut); } catch (e) { continue; } if (again && !again.open && !again.turned && !beside.some((c) => touchesBuilt(again, own, c))) { r = again; break; } } diff --git a/docs/ENGINE.md b/docs/ENGINE.md index 6e4799a..83dbb0b 100644 --- a/docs/ENGINE.md +++ b/docs/ENGINE.md @@ -964,6 +964,32 @@ currently installed): 0.67 at tight. At loose, cutoff 0.1 and fit 0.3 that is a magnet from above from about 32.3 to 34 mm and a screw hole from 32.1 to 33.8: at 33 mm a 2.1 mm magnet is refused at 2 for the housing, where the rim alone would take it. + Over a solid floor, where nothing reaches the housing, the plate could still come out + open beside it, and no cap was to blame (#85): a 6.3 mm magnet from beneath at 34.5 + mm, the cap there, left 4 edges open in A1 with an H-clip from above and 3 with a + snap clip in the wall, with Download on, and a 6.25 mm magnet at 37.5 mm, well under + its 9.2 mm cap, left 14. The pocket stops 2.2 mm under the cup (2.1 under the snap + clip's slot); its planes do not stop. They split the cell's faces where they cross + them, the weld can leave a split a few microns off its face, and the housing, cut out + of the cell afterwards, crosses that face and comes out open. At 34.5 mm the pocket's + flat nearest the junction crosses the side of the cell's region that stands a `BLOAT` + inside the next cell 0.019 mm from the seam face, beside the corner the region's top + is fanned from; the spokes are microns apart there, and the weld, which chains, put + the side's top corner 3.4 microns off its plane, where the cavity's end wall, cut on + the plane, missed it by 1.9 to 2.5 microns. The sizes that came out open follow that + flat, not the cap: on the issue's layout, sizes 0.05 mm apart, 36 came out open, and + 33 of them, from 6.3 mm at 34.5 to 15 mm at 46, H-clip or snap clip, have that flat + within 0.02 mm of the corner; they meet the cap at 34.5 mm only, and the other 3, + H-clips, are other planes falling as badly. Moving the housing, as `cutAgain` does, + leaves the face where it is. So a whole cell whose housing still comes out open has + its pockets cut again the ways `settle` takes them, and the housing out of each, and + keeps the first that comes out closed with nothing turned over and no more edges + shared with the shells beside it. Of 38,013 designs the field takes from 30 to 46 mm + (the H-clip and both snap clips put in from above or beneath, wall keys from above, a + solid floor or corner bosses, three tolerances, two pieces to four and half cells), 176 + came out open, 1,072 edges, every one with its joint put in from above, and 7 of them + folded too; all 176 come out closed with nothing folded, and no other design taken + builds other bytes. No cap moves, so the ranges above stand. - **A pocket in a corner boss counts the same way**, since the joint is cut from the boss too (#70), and from above its floor is measured from the boss's top: wall keys and the dovetail reach a boss's pocket up to about 39 mm, the H-clip up to about 34.5, diff --git a/index.html b/index.html index d2226d5..4791f5a 100644 --- a/index.html +++ b/index.html @@ -5978,11 +5978,62 @@

Your drawers

const own = [b[0], b[1], b[3], b[4]]; const beside = cutCells.filter((c) => c.box[0] < own[2] && own[0] < c.box[2] && c.box[1] < own[3] && own[1] < c.box[3]); - let r = cutAgain(shells[i], cut, csgSubtract(shells[i], cut)); + let solid = shells[i], r = cutAgain(solid, cut, csgSubtract(solid, cut)); + /* A whole cell whose housing still comes out open after every way cutAgain takes it + has its mounting pockets cut again, the ways settle cuts them again (pocketTries: + moved 1.7 microns one way along a diagonal or the other, turned a 28th of a turn, + or both), and the housing out of each, as cutAgain takes it. The first that comes + out closed with nothing turned over, and sharing no more edges with the shells + beside it than the first cut did, is kept (#85). + * + Nothing of a pocket reaches the housing over a solid floor (mountLimits): at 34.5 + mm a magnet from beneath stops 2.2 mm under an H-clip's cup and 2.1 under a snap + clip's slot. The pocket's planes reach it. Its cut, carried across the cell by the + BSP, splits the cell's faces where its planes cross them, and the weld in + healCsgSeams can move a split a few microns off its face's plane; the cell comes + out closed, and the housing, cut out of it afterwards, crosses that face. A 6.3 mm + magnet at 34.5 mm, its cap there, with an H-clip or a snap clip put in from above: + the flat of the pocket nearest the junction crosses the side of the cell's region + that stands a BLOAT inside the cell in front 0.019 mm from the seam face, beside + the corner the region's top face is fanned from. The spokes are microns apart + there, and the weld, which chains, joined the side's top corner to where the flat + crosses the second spoke, 3.4 microns off the side's plane. The cavity's end wall, + 2.5 mm in from the seam (2.83 for the snap clip), crosses the triangle the side has + up to that corner: the wall stops on the side's plane, the side split along the + wall stands 1.9 microns off it where the wall meets the triangle's lower edge and + 2.5 at the plate's top (the H-clip's), and the weld, VTOL wide, joins the one end + and not the other. A1 shipped 4 open edges, 3 with the snap clip, with Download + on. Moving the housing, as cutAgain does, leaves the side as it is; cutting the + pockets again moves the flat off the corner. It is not the cap: the sizes that + came out open follow that flat, within 0.02 mm of the corner from a 6.3 mm magnet + at 34.5 mm to 15 mm at 46, cap or not, and a pocket's planes can fall as badly + elsewhere, a 6.25 mm magnet at 37.5 mm leaving 14 edges where the cavity's walls + cross the socket's corner facets the planes had split. Of 38,013 designs the field + takes, swept from 30 to 46 mm (the H-clip and both snap clips put in from above or + beneath, wall keys from above, a solid floor or corner bosses), 176 came out open, + every one with its joint put in from above, and all of them come out closed now. + * + A cell whose housing comes out closed first time, nearly every one, is built as + before, and so is one that comes out closed with a face turned over: two such, + snap clips at 44.5 mm with an 11.1 mm magnet, fold nothing in the finished piece, + and cutting the pockets again would only have given them other bytes. */ + const cell = r.open && mountCells.find((c) => c.i === i && c.recut); + if (cell) { + const near = builtBeside(cell.box).filter((c) => c !== cell), shares = sharedAll(r, cell.box, near); + for (let k = 0; k < POCKET_TRIES; k++) { + let pockets, again; + try { pockets = cell.recut(cell.alt, k); } catch (e) { continue; } + if (!pockets || pockets.open || pockets.turned) continue; + try { again = cutAgain(pockets, cut, csgSubtract(pockets, cut)); } catch (e) { continue; } + if (again.open || again.turned || sharedAll(again, cell.box, near) > shares) continue; + solid = pockets; r = again; cell.pocket = k; + break; + } + } if (beside.some((c) => touchesBuilt(r, own, c))) for (const alt of TOUCH_TRIES) { let again; - try { again = alt(shells[i], cut); } catch (e) { continue; } + try { again = alt(solid, cut); } catch (e) { continue; } if (again && !again.open && !again.turned && !beside.some((c) => touchesBuilt(again, own, c))) { r = again; break; } } diff --git a/src/core.js b/src/core.js index 4b33e9e..a4c0af3 100644 --- a/src/core.js +++ b/src/core.js @@ -4584,11 +4584,62 @@ function buildPiece(cfg, layout, piece, onStatus) { const own = [b[0], b[1], b[3], b[4]]; const beside = cutCells.filter((c) => c.box[0] < own[2] && own[0] < c.box[2] && c.box[1] < own[3] && own[1] < c.box[3]); - let r = cutAgain(shells[i], cut, csgSubtract(shells[i], cut)); + let solid = shells[i], r = cutAgain(solid, cut, csgSubtract(solid, cut)); + /* A whole cell whose housing still comes out open after every way cutAgain takes it + has its mounting pockets cut again, the ways settle cuts them again (pocketTries: + moved 1.7 microns one way along a diagonal or the other, turned a 28th of a turn, + or both), and the housing out of each, as cutAgain takes it. The first that comes + out closed with nothing turned over, and sharing no more edges with the shells + beside it than the first cut did, is kept (#85). + * + Nothing of a pocket reaches the housing over a solid floor (mountLimits): at 34.5 + mm a magnet from beneath stops 2.2 mm under an H-clip's cup and 2.1 under a snap + clip's slot. The pocket's planes reach it. Its cut, carried across the cell by the + BSP, splits the cell's faces where its planes cross them, and the weld in + healCsgSeams can move a split a few microns off its face's plane; the cell comes + out closed, and the housing, cut out of it afterwards, crosses that face. A 6.3 mm + magnet at 34.5 mm, its cap there, with an H-clip or a snap clip put in from above: + the flat of the pocket nearest the junction crosses the side of the cell's region + that stands a BLOAT inside the cell in front 0.019 mm from the seam face, beside + the corner the region's top face is fanned from. The spokes are microns apart + there, and the weld, which chains, joined the side's top corner to where the flat + crosses the second spoke, 3.4 microns off the side's plane. The cavity's end wall, + 2.5 mm in from the seam (2.83 for the snap clip), crosses the triangle the side has + up to that corner: the wall stops on the side's plane, the side split along the + wall stands 1.9 microns off it where the wall meets the triangle's lower edge and + 2.5 at the plate's top (the H-clip's), and the weld, VTOL wide, joins the one end + and not the other. A1 shipped 4 open edges, 3 with the snap clip, with Download + on. Moving the housing, as cutAgain does, leaves the side as it is; cutting the + pockets again moves the flat off the corner. It is not the cap: the sizes that + came out open follow that flat, within 0.02 mm of the corner from a 6.3 mm magnet + at 34.5 mm to 15 mm at 46, cap or not, and a pocket's planes can fall as badly + elsewhere, a 6.25 mm magnet at 37.5 mm leaving 14 edges where the cavity's walls + cross the socket's corner facets the planes had split. Of 38,013 designs the field + takes, swept from 30 to 46 mm (the H-clip and both snap clips put in from above or + beneath, wall keys from above, a solid floor or corner bosses), 176 came out open, + every one with its joint put in from above, and all of them come out closed now. + * + A cell whose housing comes out closed first time, nearly every one, is built as + before, and so is one that comes out closed with a face turned over: two such, + snap clips at 44.5 mm with an 11.1 mm magnet, fold nothing in the finished piece, + and cutting the pockets again would only have given them other bytes. */ + const cell = r.open && mountCells.find((c) => c.i === i && c.recut); + if (cell) { + const near = builtBeside(cell.box).filter((c) => c !== cell), shares = sharedAll(r, cell.box, near); + for (let k = 0; k < POCKET_TRIES; k++) { + let pockets, again; + try { pockets = cell.recut(cell.alt, k); } catch (e) { continue; } + if (!pockets || pockets.open || pockets.turned) continue; + try { again = cutAgain(pockets, cut, csgSubtract(pockets, cut)); } catch (e) { continue; } + if (again.open || again.turned || sharedAll(again, cell.box, near) > shares) continue; + solid = pockets; r = again; cell.pocket = k; + break; + } + } if (beside.some((c) => touchesBuilt(r, own, c))) for (const alt of TOUCH_TRIES) { let again; - try { again = alt(shells[i], cut); } catch (e) { continue; } + try { again = alt(solid, cut); } catch (e) { continue; } if (again && !again.open && !again.turned && !beside.some((c) => touchesBuilt(again, own, c))) { r = again; break; } } diff --git a/sw.js b/sw.js index 6017299..09c78df 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 = "6497e774f9fa"; +const VERSION = "9c3c3ab35a1f"; const FILES = [ "./", "bins/", diff --git a/test/plate-audit.js b/test/plate-audit.js index 0ec929e..4f53351 100644 --- a/test/plate-audit.js +++ b/test/plate-audit.js @@ -2456,6 +2456,30 @@ console.log('\nthe other limits, built at their ends:'); console.log(` ${'counterbore at 44.08 mm'.padEnd(28)} ${leakText(r)}`); if (r.bad) bad++; } + /* A pocket's planes beside a housing put in from above, over a solid floor (#85). + Nothing of the pocket reaches an H-clip's cup or a snap clip's slot there, 2.2 and + 2.1 mm of floor between them at 34.5 mm, but its planes split the cell's faces, and + the repair can leave a split a few microns off its face, which the housing, cut + afterwards, crosses. A 6.3 mm magnet from beneath at 34.5 mm, the field's cap, left + 4 edges open in A1 with an H-clip from above and 3 with a snap clip in the wall, + with Download on: the page's links, so with the clearances cut from the field. A + 6.25 mm magnet at 37.5 mm, well under its 9.2 mm cap, left 14. Such a cell has its + pockets cut again now (the top-insert pass in buildPiece). Each has to be taken by + the field and build watertight, with nothing folded, and so does the H-clip at its + 42 mm cap, which always did. */ + for (const [nm, o, d] of [ + ['H-clip above, 6.3 magnet, 34.5', pair(34.5, { connector: 'hclip', keyInsert: 'top' }), 6.3], + ['snap clip above, 6.3 magnet, 34.5', pair(34.5, { connector: 'snap', keyMount: 'wall', keyInsert: 'top' }), 6.3], + ['H-clip above, 6.25 magnet, 37.5', pair(37.5, { connector: 'hclip', keyInsert: 'top' }), 6.25], + ['H-clip above, 13.6 magnet, 42', pair(42, { connector: 'hclip', keyInsert: 'top' }), 13.6]]) { + const at = { ...o, clr: 0.2, magnets: true, magnetD: d }; + const cfg = designCfg(at); + const taken = d <= G.mountLimits(cfg, G.computeLayout(cfg)).magnetD + 1e-9; + const r = buildAll(at); + const folds = r.pieces.reduce((s, pp) => s + checkOrientation(pp).folds, 0); + console.log(` ${nm.padEnd(34)} ${taken ? '' : 'REFUSED, '}${leakText(r)}${folds ? `, ${folds} FOLDS` : ''}`); + if (!taken || r.bad || folds) bad++; + } /* The clearance one step past its end, which leaked, and that was why the end is where it is. The joint's cut taken again when it comes out open (cutAgain in core.js) closed it at 42 mm, so it waited on a sweep; the sweep connClrCeiling describes found