Repository navigation
Gridfinity: text raised on the label shelves (Discussion #1308) - #1357
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
|
@mlugo-apx thank you, this is great work! Merged. The letters on the shelves look really clean, and having them in the exact body, so they come along in the STEP export, is a big plus. |
Owner
|
@mlugo-apx your label text is out in layerling 1.145.0. Thanks again! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For Discussion #1308, where you asked what a label generator would add for Gridfinity: the label shelves can now carry their label themselves, as raised letters that are part of the bin, so they print with it and a filament change at the shelf's top colours them.
Summary
A 2 x 1 bin with "M3 Screws" on its back shelf, and a 3 x 2 bin with a label in each compartment:
How it is built
lib/gridfinityLabelText.ts(new; it makes letters only on the page, where the fonts are): lays a shelf's text out with kerning (straightTextShapes), fits its ink box into the shelf's room, and gives the rings for the display mesh and the placed glyphs, whichcadModifierGridfinityForShapeturns into loops with the font's curves (glyphLoop) for the exact body. Below a capital of 3 mm the text is left out.lib/gridfinityGeometry.ts:labelPiecesInalso returns each shelf's room (the margins above);gridfinityLabelTextPlacesplaces every shelf's text in the bin, per wall and compartment, with the reading direction and the mirroring;gridfinityLabelTextGiven(from the settings only) andgridfinityHasLabelText(a built shelf carries letters). In the display mesh each glyph is its own even-odd section, joined after the shelves, sunk 0.05 mm into the shelf so it is one body with it.lib/gridfinitySolid.ts: the exact letters are each glyph extruded from its curves (profileExtrusionSolid) and fused after the shelves; a fuse that loses more than a tenth of the letters throws.lib/cadProfileExtrusion.ts: the letters travel in the gridfinity part;cadGridfinitySegmentCountcounts them for the edge tool's prepare time, andwithinExactProfileLimitcounts them in the 700-piece request budget, past which some bins go as their meshes. STEP export builds them always.lib/geometryWorker.ts: a bin with letters stays on the page for grouping, Split, Check clearance, STEP and the other worker tasks, as a text does ([Bug]: Loading Fonts message when attempting to export as STEP file #1337), since the worker has no fonts.viewportShapeObjects.tsandeditorMeshCore.ts: the texts, font and mirroring are in the signature and topology key; the unplaced-mesh cache keeps lettered bins with the font revision.mcpShapeSettings.ts:mcpGridfinityPatchgiveslayerling_create_shapeandlayerling_update_objectthe list and text settings together.Testing
On 0f2e797 (on main at 550d7fb, 1.144.0):
npm run typechecknpm test(4686 tests; one,meshSurfaceSegments.test.ts"puts a knot down as free-form...", timed out at 5 s while the machine was busy and passes on its own, 7 of 7; the file is not touched here) andnpm run test:e2e(1078)npm run buildandnpm run exportgridfinityLabelText.test.ts,gridfinityGeometry.test.ts,geometryWorker.test.ts: the room on every wall, and without the lip, at rounded and chamfered ends, thick walls, neighbouring shelves and dividers; the letters' height against the stacked feet; the fit and the 3 mm boundary; reading direction on each wall, mirrored X, Y and Z; one body; kerning; Script letters that run into one another; Stencil's straight segments; Japanese once its face arrives; fonts not loaded; trays, switched-off shelves and blank texts; the signature, topology key and mesh cache; the edge tool's shared budget and segment count; the MCP patch and its two calls in the editor; saved files, defaults and validation.cadGridfinityLabelText.e2e.tsandgridfinityLabelTextStep.e2e.ts(the real kernel): the exact letters against the display mesh, in volume and in where they stand, on walls, in compartments and mirrored; a fuse that loses the letters throws; the STEP file has them.gridfinityLabelTextPanel.e2e.ts: the rows, the font, one undo step for typing, the note.Notes
labelPiecesInreturns each shelf's room;withinExactProfileLimitcounts a bin's letters in its budget and dropsgridfinityfrom a part it sends as its mesh;layerling_create_shapeandlayerling_update_objectcallmcpGridfinityPatchinstead ofgridfinityListPatch, which gives the same list patch plus the texts (update_objectnow calls it for every bin; it writes nothing when none of a bin's own settings is given);createGridfinityGeometryandgridfinityLabelledTrianglestake the letters as an optional argument;TextPropertytakes ahint; the unplaced-mesh cache stores a font revision for lettered bins;containsTextcounts a bin with letters.🤖 Generated with Claude Code