Skip to content

Gridfinity: magnet holes in a baseplate (Discussion #2236) - #2350

Open
mlugo-apx wants to merge 1 commit into
henmedia:mainfrom
mlugo-apx:magnet-baseplate
Open

mlugo-apx wants to merge 1 commit into
henmedia:mainfrom
mlugo-apx:magnet-baseplate

Conversation

@mlugo-apx

Copy link
Copy Markdown
Contributor

For Discussion #2236: the magnet holes in a baseplate that @Joepic9 asked for, the follow-up to #2248 you agreed there.

Summary

  • A baseplate now has the Magnet holes switch a bin has, above Swallowtail. Switched on, a plate stands on a 3.6 mm floor, the floor a hollowed box gets with magnets (Discussion Idea: a box generator for enclosures and Gridfinity drawers (not a pull request yet) #1693), and is 8.6 mm tall instead of 5. In each corner of every socket a hole 6.5 mm wide and 2.4 mm deep opens upwards in the floor, 13 mm from the cell's middle both ways, exactly under a bin's own holes, with 1.2 mm of floor below it; a 6 x 2 mm magnet sits 0.4 mm below the socket's bottom, and the plate prints without supports.
  • A half cell in the padding (Gridfinity: a baseplate's padding holds half cells for bins on the half-size grid (Discussion #2078) #2101) has one hole, where a whole cell's would be if the grid went on into the padding: 2.5 mm off its middle, towards the grid across the row and towards its unit's corner along it. A half-size bin's hole falls there only in some places, so the guide says to check before pressing the magnets in.
  • With Swallowtail as well the plate keeps the one floor of 3.6 mm and its pockets are cut up into it as before; clip notches stand on the floor; a plate split to fit the printer keeps the holes on every piece, also with GridFlock's puzzle. Not on a plate fitted to an outline.
  • Texts: a hint under the plate's settings and Swallowtail's hint, which now also gives the floor with magnet holes, in all 22 catalogues; guide chapter 9 in 16 languages; the MCP descriptions of gridfinityMagnets, gridfinityType, gridfinitySwallowtail, gridfinityClipNotches and gridfinityPaddingBack. Changelog entry under a new Gridfinity section and a What's new card.

How it is built

  • gridfinityGeometry.ts: the plan gets plateFloor (Swallowtail's, the magnets', or none), read where the plate's floor was swallowtail ? 2.4 : 0 (the mesh, the half sockets, the clip seat, the exact body's sockets) and passed to gridfinitySize, so the footprint, the shape patch and split pieces come out 8.6 mm; shapeCatalog.ts hands the flag to the toolbar's new plate, as it does Swallowtail. The whole cells' holes are drawn into the plate's own triangles with the loop the bin's feet already had, now a magnetHole closure both use (the bin's mesh is the same to the last bit); the half cells' holes are cut by Manifold with their half sockets. The exact body (gridfinitySolid.ts) cuts all holes in the same cutAll as the sockets.
  • ShapeInspector.tsx: the switch, as Swallowtail's, through the shape patch, so one click is one step to undo; the hint under the settings as the Swallowtail and clip-notch hints.

Testing

On d2ce3d171, on main at cf0b0f8.

  • npm run typecheck, npm run build and npm run export
  • npm test (8,414 of 8,415 tests in 893 files) and npm run test:e2e (2,292 in 268). The one that fails, ag7Vase.test.ts ("says for every outline what all rays against all edges say"), is the one I mentioned on Gridfinity: a compartment's size is no longer hidden under the move arrows (Discussion #1799) #2268: it timed out at 5 s here, fails in some full runs on main as well and passes on its own (again on d2ce3d171).
  • In the editor, on 4f7f61ed2 (the same code before the last two rebases): the switch above Swallowtail, one click 7.4 -> 8.6 mm with the hint, one step to undo and redo; disabled on a locked plate; German, Graphite and a window 860 px wide; a 12 x 12 plate edited seven times (Swallowtail, half cells, clip notches, padding, magnets off and on), its exact body built after each in 9.7 to 13.9 s.
  • gridfinityGeometry.test.ts: floor, height and patches; the hole places (a 3 x 2 plate's 24 are a 3 x 2 bin's; all 36 of a 2 x 2 plate with half cells all round, worked out by hand); the volumes by hand (2 x 1, 3 x 2, Swallowtail, a row of half cells); closed meshes in one piece for 11 cases up to 12 x 12; the clip seat; the toolbar's plate. gridfinityPuzzle.test.ts: puzzle pieces with magnets, closed raw and welded, no puzzle part within 0.5 mm of a hole (the nearest is 2.41 mm). cadGridfinityShape.e2e.ts: magnet plates as one valid solid with the mesh's volume and box, the exact volume by hand, every hole where the plan has it on a plate with half cells at the back, 12 x 12 with its 576 holes, a bin with magnets seated in a magnet plate. gridfinityPaddingPanel.e2e.ts: the switch above Swallowtail, none on an outline plate, one patch per click (8.6, 7.4 with Swallowtail, 5), the hint only on a magnet plate.
  • In the last round of review, on 4dd783a29 (the same geometry; since then only tests, texts and a shared hole filter, checked byte for byte), a reviewer probed about 2,000 plates (sizes up to 12 x 12, padding, half cells, Swallowtail, corner pockets, clips, puzzle, split pieces, corner radius) and 36 exact bodies, after about 700 plates and 90 exact bodies in the two rounds before: closed, the holes four per socket and one per half cell, each with wall round it and its bottom at 1.2 mm. The drawn meshes of bins and of plates without magnets are the same to the last bit as on main.
  • Timing, 12 x 12. Exact body in the browser (Chrome, list_edges), on 4f7f61ed2 with clip notches: 9.9 s without magnets, 9.7 s with. During the build, with the same exact-body code on an earlier commit: 9.3 / 8.7 s without, 9.3 / 9.0 s with; an edge-tool chamfer of the outer rim took 10.7 s, and a fillet the kernel refuses was refused in 22.7 s. Display mesh in Node, measured by a reviewer on an earlier commit with the same geometry: plain 22 -> 28 ms (no Manifold); with Swallowtail 128 -> 311 ms, half cells all round 320 -> 535 ms, both 296 -> 560 ms, from about 51,000 to 125,000 triangles going into Manifold.

Notes

  • A baseplate that already carries gridfinityMagnets (a bin with magnet holes made into a baseplate, defaults saved on one, or an MCP plate given the flag) gets the floor and the holes once it is opened again, and bins standing on it end up 3.6 mm in it. The changelog says so; if you would rather a bin's flag not carry over, the type change in gridfinityShapePatch is where to drop it; plates already saved with it would still need a step when a file is opened.
  • The display mesh with Swallowtail, clip notches or half cells (and with the GridFlock puzzle, which goes the same way; not timed) takes one and a half to two and a half times as long at 12 x 12, as the holes are real 32-gons like the bin's. That path runs on the main thread; it may be worth moving to the worker some day.
  • Left as they were: the baseplate hint's "5 mm tall" and the guide's clip-notch sentence "keeps its 5 mm", both already off with Swallowtail.
  • Translations a native reader might look at: the joining and magnet sentences in cs, hu and ar (and the magnet one in zh-cn and zh-tw, which no native reader checked), and the word order of the Swallowtail hint's bracket in ru; it and pt-pt name Swallowtail in the new hint as their own Swallowtail hint does, not as the switch.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant