diff --git a/.agents/skills/layerling-mcp-skill/SKILL.md b/.agents/skills/layerling-mcp-skill/SKILL.md
index b5768cd6b1..4de0ec05c6 100644
--- a/.agents/skills/layerling-mcp-skill/SKILL.md
+++ b/.agents/skills/layerling-mcp-skill/SKILL.md
@@ -66,7 +66,7 @@ Useful tools:
- `layerling_rename_project`: give the project a name (`name`, at most 80 characters), as the pencil beside the project name does, so a design is easy to find in the project list later. `layerling_list_editors` and `layerling_read_scene` report the project's name: check it before changing a design, so the shapes land in the right project.
- `layerling_delete_objects`: delete ids in the live editor, or delete the current selection when ids are omitted
- `layerling_move_object`: move an object to another place in the object list (the design's own order): `id`, and `before`, the id it goes in front of (omitted: last). One undo step..
-- `layerling_create_shape`: create any shape the editor has a tile for - `box`, `cube`, `cylinder`, `polygon`, `sphere`, `cone`, `pyramid`, `wedge`, `roundRoof`, `halfSphere`, `paraboloid`, `curvedCone` (a cone whose side bends: `curvedConeTop` the top as a share of the bottom, `curvedConeBend` -1 inward to a trumpet, 1 outward to a dome), `torus`, `tube`, `loft`, `text`, `thread`, `spring`, `gridfinity`, `gear`, `hirth`, `pulley`, `finishingWasher`, the enclosure parts `boxGenerator` (a box or its lid from settings: `boxShape` rectangle, round or polygon, `boxWall`, `boxFloor`, `boxColumns` and `boxRows` for fixed compartments, `boxPart` box or lid, `boxLidStyle` restOn, overlap or plug, `boxFit`; make one shape per part with the same settings), `screwBoss` (a post with a hole: `screwBossFastener` insert, selfTapping or custom, `screwBossSize` M3, #4-40, ST2.9 ..., optional `screwBossGussets`), `snapFit` (a cantilever hook and its catch: `snapFitPart` both, hook or catch, `snapFitUndercut`, `snapFitRetainAngle` 90 holds for good, 45 comes apart) and `rib` (`ribStyle` straight or gusset; `ribFoot: true` stands it on a thin, wider foot for more hold on the bed, `depth` then the foot's width, `ribThickness` the rib's and `ribFootThickness` the foot's; `ribFootShape: "oval"` makes the foot an ellipse without corners, just long enough that the rib's ends still stand on it, `width` then the ellipse's length and the rib inside it shorter) - or a `sketch` extrusion; a `sketch` with `stroke: { width, align, join, cap }` is built as a frame of that width round its outline (align `center`, `inside` or `outside`), as the editor's Stroke does, or with align `grow` as the area widened by that width. Size and everything beyond it are optional and fall back to what the editor uses when the same shape is placed by hand. A `thread` is a rod, a screw, a nut or a tapped hole, set through `threadRole`; its width and depth follow `threadDiameter` and are not given separately. `threadHead` is a screw's head (`cylinder`, `countersunk`, `hex`, `square`, `flange`, `wing`, `knob`) and a nut's shape (`hex`, `square`, `flange`, `wing`, `knob`); a wing or knob prints lying flat and is turned by hand. `threadCollarHeight` puts a round collar between a screw's head and its thread (not under a countersunk head), a spacer under a star knob or a shoulder under a head, or on a nut's top face; `threadCollarDiameter` sets its width (twice the thread by default, always inside the head or nut), and the thread keeps its length (a nut its body). For a standard size pass `threadSize` with its name from the editor's size menu - `M6`, `1/4"-20 UNC`, `G1/2`, `1/2" NPT` - instead of `threadDiameter` and `threadPitch`; a lead screw with several threads side by side takes `threadStarts` (T8x8: `threadDiameter` 8, `threadPitch` 2, `threadStarts` 4, `threadProfile` `trapezoidal`; a size sets it back to 1); an NPT size is tapered (`threadTaper` true: 1 in 16 on the diameter, which is the wide end's; a rod or screw narrows towards its tip at the top, a nut or tapped hole widens towards its mouth at the top), every other size straight, and `threadTaper` tapers any thread; a `settings` block read back with all three still works, a diameter or pitch that does not match the size is refused. `threadClearance` gives nuts and tapped holes room (default 0.2 mm); `threadBoltClearance` makes a rod or screw that much thinner in diameter (default 0), for a printed bolt that has to go into a metal nut. `threadProfile` `custom` is a symmetric trapezoid you shape yourself: `threadFlankAngle` (10 to 90 degrees between the two flanks, default 60) and `threadDepth` (mm, outer minus core radius; the core diameter is `threadDiameter` minus twice that), for example 90 degrees and a depth of 0.4 x the pitch for a thread that prints without supports. `threadAxialClearance` (default 0, at most a fifth of the pitch) gives nuts and tapped holes play along the axis: each tooth of the part gets that much thinner while the diameter stays, so a printed thread can turn freely without rattling sideways - try `threadClearance` 0.2 with `threadAxialClearance` 0.2. A `spring` winds right-hand like a usual compression spring; `springHand: "left"` winds it the other way. `springForm: "flat"` makes it a flat spring instead (#1076): a band running in waves across the plate, printed lying down - `width` is its length, `depth` how far the waves reach, `height` its thickness (a new one is 60 x 16 x 4 unless sizes are given; switching an existing spring keeps its size, so pass the new sizes with it). `springPattern` is `round` (default), `zigzag` or `square`, `springEnds` `eye` (default, a ring with a hole at each end), `tab` or `none`; `springTurns` counts its bends and `springWire` is the band width. It is an exact body. A G size is a parallel Whitworth pipe thread (BSPP, ISO 228-1, as on fittings for water, gas, hydraulics and pneumatics; G1 is 33.249 mm across with 11 threads per inch) and turns a `v` profile into `whitworth`, the 55 degree profile with rounded crest and root; an M, UNC or UNF size turns `whitworth` back into `v`. `PCO 1881` is the 28 mm neck of most water and soda bottles (27.4 mm across, pitch 2.7, #1079): it sets `threadProfile` `custom` with `threadDepth` 1.6 and `threadFlankAngle` 30 unless the call gives them; make the neck a `rod` and the cap a `nut`, or a `bore` taken out of a cylinder. `S60x6 (IBC)` is the outlet thread of IBC containers (DIN 6063-1, KS 60: 60 mm across, pitch 6, core 54; #1094) and sets `custom` with `threadDepth` 3 and `threadFlankAngle` 30 the same way; its real flanks are unequal, the profile has two equal ones. A cylinder without `sides` picks its own side count from the diameter, the way the editor does. A `teardrop` is the cross-section of a horizontal hole that prints without supports: `width` is the diameter of its round part, `depth` its length along the hole and `height` the full height up to the tip (about 1.207 x width gives the usual 90 degree tip; the editor's tip angle is derived from it). A `port` is the opening for a USB, HDMI, DisplayPort or RJ45 socket in a box wall, lying on its side like the teardrop and a hole from the start: `portPreset` (`usbC`, `usbCPlug`, `microUsb`, `usbA`, `hdmi`, `miniHdmi`, `microHdmi`, `displayPort`, `miniDisplayPort`, `rj45`) gives the socket's size from data sheets with a little room, and `portClearance` (0 to 2 mm, #1098) adds that much more on every side, the corners rounder by it; otherwise `width` and `height` are the opening seen from the front, `cornerFillet` its corner radius, `portProfile` cuts the lower corners as on HDMI or DisplayPort and `depth` is how far it reaches through the wall. A `tube` with `washer` (`M1.6` to `M30`) is that screw size's washer to ISO 7089 (M5: 10 mm across, 5.3 mm bore, 1 mm thick). A `counterbore`, `countersink` or `doubleCountersink` with `screwSize` (`M2` to `M30`, a countersink up to `M20` and the inch sizes `#2` to `#14`) takes that screw's hole: shaft as the ISO 273 medium clearance hole (M5 5.5 mm), a counterbore's head to DIN 974-1 (M5 10 mm, as deep as the diameter plus 0.4), a countersink's to ISO 15065 at 90 degrees (M5 10.4 mm); an inch size is ASME B18.6.1 at 82 degrees, which are also the Australian gauges (#6: head 7.09 mm, shaft 3.9 mm). A screw hole's `height` is its whole length. Socket head cap screws are sold by the length under the head, so a counterbore for one takes `height` = that length plus `screwHoleHeadDepth` (M3 x 12 with the 3.2 mm pocket: 15.2), as the counterbore's field Screw length does (#1670); countersunk screws are measured with the head, so a countersink's `height` is the screw's length. A `finishingWasher` is the domed washer (rosette) under a countersunk screw (#1131): flat underneath, a dome rising from a low rim to the seat, a cone of `screwHoleAngle` (90 default) `screwHoleHeadDepth` deep for the head, and the bore `screwHoleShaft`; `width` is its outer diameter (it stays round), `height` the whole height. With `screwSize` (`M2` to `M20`) it takes that screw's measures (M3 10.3 x 2.95 mm, M6 16.6 x 4.5 mm). It is an exact body. A `polygon` with `nut` (`M2` to `M30`) is the pocket for that ISO 4032 hex nut, 0.4 mm wider across flats (`width`) and higher than the nut; make it a `hole`. A `counterbore` (round head pocket, `screwHoleHeadDepth`) or `countersink` (cone, `screwHoleAngle`, 90 for a countersunk screw) is a cutter for a screw head: `width` is the head diameter, `screwHoleShaft` the shaft diameter, `height` the whole length, head end on top; set `hole` and let its top end a little above the surface. A blind hole can end in a drill point (Discussion #621): `drillPointAngle` (60 to 150, 118 for a common twist drill) on a `cylinder` set as `hole`, a `counterbore` or a `countersink` puts the cone of the drill's tip below its bottom, as wide as the hole or the shaft; the `height` stays the depth to the shoulder, as in a drawing, and the tip reaches (diameter / 2) / tan(angle / 2) further down, so a hole 10 deep and 5 wide at 118 ends 11.5 below its top. `drillPointAngle` 0 makes the bottom flat again. `screwHoleSlot` true on a `counterbore`, `countersink` or `doubleCountersink` makes it a slotted hole for lining a part up (#1531): the shorter of `width` and `depth` is the head diameter, the difference the slot's length along the longer one (width 14, depth 6.6: an M3 countersink with a 7.4 mm slot along x); `screwHoleRecess` on a `countersink` or `doubleCountersink` sinks the head that many mm below the face with a straight pocket as wide as the head above the cone (#1531); it has no drill point. `screwHoleChamfer` on a `counterbore` puts a 45-degree chamfer that many mm deep on the rim of the pocket (#1632), opening outside the head diameter so the head still fits; it stays shallower than the pocket. A `doubleCountersink` is a hole chamfered on both faces (#392): `width` is the head diameter at both ends, `screwHoleShaft` the shaft between the two cones, `screwHoleAngle` the cone angle (90 default), `height` the whole length; if two full cones do not fit, they meet in the middle at that angle and the shaft stays wider than set. Push it through a part as a `hole`. A `hinge` is a print-in-place hinge lying open flat: `width` is its length along the axis, `depth` both leaves together, `height` the knuckle diameter; `hingeKnuckles` (odd, default 5), `hingePinDiameter`, `hingeLeafThickness` and `hingeClearance` (default 0.4 mm, raise it if a printer fuses the parts) set the rest, and it prints in one piece; `hingePinless: true` leaves the printed pin out and runs the bore through every knuckle, for a pin of your own; `hingeAngle` (-180 to 180, default 0) folds the second leaf up about the pin, 0 lying flat, 180 closed, below 0 folded down past lying flat. `hingeStyle: "liftOff"` makes a lift-off hinge: two knuckles, the pin on the lower one, the upper one a sleeve that comes off it. `hingeStyle: "snap"` makes a snap-on hinge (Discussion #1520): one leaf's knuckles carry the pin, the other's are clips open on top (the side facing the other leaf when closed), narrower than the pin by `hingeSnapGrip` (default 0.3 mm) with a 45 degree lead-in; separate the parts, print both halves flat without supports, then press the clip half onto the pin, closed, until it clicks. `hingeScrewHoles` (0 to 6 per leaf) adds screw holes with `hingeScrewDiameter`, `hingeScrewSpacing` (along the axis) and `hingeScrewAcross` (centre to centre across both leaves), countersunk unless `hingeScrewHead` says `straight`, `nut` (hexagonal nut pockets, their size by `hingeNutWidth`) or `countersunkNut`; `hingeCornerRadius` rounds the leaves' outer corners; `hingeLeafStyle: "fingers"` gives each knuckle its own finger instead, the two sides alternating like combs, to fold all the way round and to join to a box and its lid; `hingeLeafStyle: "raised"` lifts the second leaf so that, closed, it lies flat on the first with the clearance between, and the hinge folds well past lying flat (it prints with supports under that leaf). A `gridfinity` is a bin or a baseplate for the Gridfinity storage system, to the published measures so it fits parts printed from other designs: `gridfinityType` `bin` (default) or `baseplate`, or `tray` (#837), a tray of any size with a flat bottom and no feet, lip or magnet holes: its `width` and `depth` are free in mm (10 to 252) and its `height` too (3 to 140), kept as given (a new one is 80 x 40 x 20), and the bin's settings below apply to it except the lip, the lip chamfer, the magnets and the half-size grid; its floor starts at 1.2 mm, it takes as many compartments as leave each at least 6 mm wide (up to 24 along a side and 40 in all), and its dividers and label shelves run up to its top. A bin's or baseplate's size is whole grid units of 42 mm, and any `width`, `depth` or `height` is rounded to them: a bin is 42 x units - 0.5 across and deep (41.5, 83.5 ... up to 6 units) and 7 mm per height unit (up to 20) plus 4.4 for the stacking lip (a 3-unit bin is 25.4 tall); a baseplate is 42 x units across and deep, up to 6 units, or 12 with `gridfinityLargePlate` (default false, for print beds over 256 mm), plus its padding, and 5 tall. `gridfinitySwallowtail` (default false) puts a baseplate on a 2.4 mm floor, 7.4 mm tall, with half a bow-tie pocket under each side without padding, so two plates side by side make whole pockets across the seam; `gridfinityKeys: true` on create or update lays out its keys in front of it, one for each pocket at its back and right, returned as parts (not for an outline plate); `gridfinitySwallowtailClearance` (mm, 0 to 0.15, default 0.05) is how much smaller than its pocket each key is on every side, raised if printed keys jam or break. A baseplate given `gridfinityOutline` (points `{ x, z }` in mm in its own frame) fills that outline instead: whole 42 mm cells inside it get sockets, at most 6 across and 6 deep (12 with `gridfinityLargePlate`), the rest is solid, and its box is the outline's bounds, at most 334 mm a side (586 mm with `gridfinityLargePlate`) and at least 10 mm; an empty list takes the outline away. On a bin, `gridfinityLip` (default true) is the stacking lip and `gridfinityMagnets` (default false) adds holes for 6 x 2 mm magnets under each foot; a baseplate has none. `gridfinityHalfGrid` (default false) puts a bin on a half-size grid: width and depth count cells of 21 mm (21 x units - 0.5, up to 12 units), each with its own foot, four to an ordinary baseplate's socket; with magnets each foot gets one hole. A bin of 3 height units or more takes label shelves along its inner walls (their top 0.85 mm below 7 mm per height unit, clear of the feet of a bin stacked on the lip): `gridfinityLabelBack`, `gridfinityLabelFront`, `gridfinityLabelLeft` and `gridfinityLabelRight` (default false, any together; where two meet they join), each with its own width, length and offset, as in `gridfinityLabelBackWidth` (mm out from the wall, default 14, at most about 17 in a bin of 3 units), `gridfinityLabelBackLength` (0, the default, runs it from wall to wall) and `gridfinityLabelBackOffset` (moves a set length along its wall from the middle; positive is +x on the back and front walls and +z on the sides), and likewise for Front, Left and Right; and `gridfinityLabelCorner` `round` (default) or `chamfer` with `gridfinityLabelCornerSize` (default 2, 0 for sharp corners) for the corners where a shelf meets a wall or another shelf. Any bin of 2 height units or more takes finger scoops, the floor rising along a quarter circle into the wall: `gridfinityScoopBack`, `gridfinityScoopFront`, `gridfinityScoopLeft` and `gridfinityScoopRight` (default false, any together), with one `gridfinityScoopRadius` (mm, at least 3.5; unset, it is half the height from the floor up to the lip's support, or to the top without the lip: 6.7 in a bin of 3 units with the lip and the 0.95 mm wall); every floor edge of the bin is then rounded as much as its inner corners (2.8 mm with the 0.95 mm wall). `gridfinityFloorHeight` (mm from the underside, default 5.95) raises the floor of a bin, solid up to it, for a blank to cut shapes into: with the lip a bin still stacks on it up to the lip's support (19.35 in a bin of 3 units with the 0.95 mm wall), and from the lip's top up (25.4 for 3 units) it fills the lip too, a solid block with a flat top; between the two it is built at the highest floor a bin still stacks on; without the lip, at most the top; scoops start on it and shelves can reach less far out above it; both are left out when it leaves them no room. `gridfinityOpenBack`, `gridfinityOpenFront`, `gridfinityOpenLeft` and `gridfinityOpenRight` (default false, any together) take away that side's wall and lip above the floor; the walls beside it run out to the outline and end square, so open bins side by side make one continuous run, the floor runs flat to the edge, and a shelf or scoop on an open side is not built, nor a compartment label. `gridfinityOpenings` opens a side switched open only partly: one entry per side with `side`, `depth` (mm down from the lip's top, at least 2), `width` (mm along the side, at least 5), `align` (`start`, `middle` by default, or `end`) and `distance` (mm from that end); without an entry, at the whole width down to the floor (each within 0.5 mm), or where the side's straight part is shorter than 5 mm, the side is open in full, and anything less cuts a notch out of its wall and lip, which keep their rounded corners; shelves, compartment labels and scoops stay off that side, and a bin built solid by its wall takes no notch. `gridfinityOpeningCorner` (`round` by default or `chamfer`) and `gridfinityOpeningCornerSize` (mm, 0 to 10, default 0 for square) round or chamfer every notch's two top and two bottom corners seen from outside the wall; each corner takes at most what the notch and the wall beside it leave, the top ones first, and up to 0.5 mm less where it would end just beside an edge of the wall, to keep clear of it; under 0.5 mm it stays square, a notch across the whole side has no top corners, and an end run out to the outline beside a side open in full has none. `gridfinityLipChamfer` (a bin with the lip, mm, 0 to 1, default 0 for the sharp top the specification draws) chamfers the lip's top edge as the edge tool's chamfer of that size would, down the outer wall and down the slope a stacked bin rests on; the height setting and how high bins stack stay as they are, and the top comes down by 0.71 x the chamfer. `gridfinityWallThickness` (a bin, mm, default 0.95, from 0.8 up to where the walls meet) sets the wall in from an outside that never changes, so the bin still fits and stacks; over 1.75 mm with the lip the wall stops at a ledge 0.85 mm under 7 mm per height unit, clear of a stacked bin's feet, a wall that leaves less than 1 mm inside builds the bin solid, and scoops, shelves and compartments that no longer have room are left out or fewer. `gridfinityPaddingBack`, `gridfinityPaddingFront`, `gridfinityPaddingLeft` and `gridfinityPaddingRight` (baseplate only, mm, default 0, at most 41) add a solid border at the plate's height outside the grid, so the plate fills a drawer that is not whole units; width and depth are the whole plate with its padding, and a padding given without width and depth keeps the units. `gridfinityCornerRadius` (baseplate only, mm, 0 to 4, default 4) sets the radius of the plate's four outer corners, 4 as the specification draws them, down to 0 for a drawer's square corners; the sockets keep theirs, so bins fit as before. `gridfinityBinCornerRadius` (bin only, mm, 0 to 3.75, default 3.75) sets the radius of a bin's outer corners above its feet, down to 0 so bins side by side in a drawer leave only their 0.5 mm gaps where four meet; the feet, the inside and the lip's slopes keep their rounding, and the wall's first 0.5 mm over the feet keeps 3.75, so the bin fits and stacks as before. `gridfinityCompartmentsX` and `gridfinityCompartmentsZ` (default 1) divide a bin of 2 height units or more into compartments with dividers of the full height (their top 0.85 mm below 7 mm per height unit, like the shelves), up to 4 per grid unit each way and 40 in all, each compartment at least 6 mm wide; `gridfinityDividerThickness` is mm, 0.8 to 3 (default 1.2), and `gridfinityDividerPositionsX`/`gridfinityDividerPositionsZ` place the dividers in mm from the inside of the left or back wall to each divider's middle (unset or `[]`, evenly spaced; once set, that axis keeps them in mm when the bin is resized; giving a count puts that axis's dividers back evenly spaced unless its positions are given in the same call). Scoops repeat in every compartment against the wall or divider on their side, made smaller in a narrow compartment and left out where even 3.5 mm does not fit. A divided bin of 3 height units or more takes `gridfinityCompartmentLabels` instead of the wall shelves: a list of `{ column, row, side, length, align, width, text }`, one per compartment (column 0 the left, row 0 the back; side `back`, `front`, `left` or `right`, the wall or divider it stands against; length 10 to 100 per cent of that side; align `start`, `middle` or `end`; width mm, default 14; text, see below), with the shelves' corner settings. A shelf can carry a text raised 0.4 mm on its top as part of the bin: `gridfinityLabelBackText`, `gridfinityLabelFrontText`, `gridfinityLabelLeftText`, `gridfinityLabelRightText` or a compartment label's `text`, one line of up to 24 characters in `gridfinityLabelFont` (a built-in font, default Multilanguage, or a font of one's own by its name or id), fitted as large as the shelf's top lets it, or with capitals `gridfinityLabelTextSize` mm high on every shelf where it lets them (0, the default, for as large as each lets them); a text whose capitals would be under 3 mm is left out, and a tray has none. `gridfinityLabelColor` (#rrggbb, an empty string for the bin's own colour) gives the letters a colour of their own: the bin stays one body, a 3MF carries the letters' faces in that colour, painted for OrcaSlicer and PrusaSlicer 2.9 too, and an OBJ their points. A bin is an exact body, so the edge tool and STEP work on it. A `loft` ("Übergang" in German) joins an outline at the bottom to another at the top with a straight-ruled wall - a hose adapter, a square fan onto a round duct, a stand: `loftBottomOutline` and `loftTopOutline` are `round` (circle or ellipse), `rectangle` (corners rounded by `loftBottomCorner`/`loftTopCorner`) or `polygon` (`loftBottomSides`/`loftTopSides`), `loftBottomWidth`/`loftBottomDepth` and `loftTopWidth`/`loftTopDepth` size the ends, `loftOffsetX`/`loftOffsetZ` move the top sideways (the bottom stays put), and `loftWall` above 0 makes it a tube open at both ends; `loftTopWall` gives the top end a wall of its own (3 mm at the bottom and 1 mm at the top, say; left out it follows `loftWall`, and sections in between take the wall evenly by their height). `loftSections` (#1034, up to 12) puts sections between the ends, each `{ at, outline, width, depth }` with `at` a share of the height (0.01 to 0.99) and `corner`, `sides`, `offsetX`, `offsetZ` as needed, and the body goes through all of them: `loftThrough` `smooth` (default, one curved surface) or `straight` (flat walls from section to section); twist, tilt and `loftSmooth` are left aside while there are sections, and `[]` removes them. `loftSmooth` (0 to 1, default 0) lets the sides follow an S-curve between the ends instead of a straight line, for a hose adapter that flares smoothly; `loftSegments` (16 to 360, default 96) sets how many straight pieces a full circle or rounded corner is drawn with in the view and the exports; `loftTwist` turns the section evenly from bottom to top about the vertical (degrees, up to 360 either way), and `loftTiltX`/`loftTiltZ` tilt the top end (degrees, up to 45: positive raises its front +z edge / its right +x side); the sections tilt evenly on the way up and the highest point stays at the height. Its width and depth are what both ends need together and are not given separately; `settings` reports the ends as the body shows them. It is an exact body, so the edge tool and STEP work on it. A `gear` gets involute teeth that mesh (`gearProfile: "involute"`, the default for a new gear; `"simple"` is the plain straight teeth older designs have, set by `toothSize` and `toothWidth`). An involute gear is set like a gear generator: its `width` and `depth` are its outside diameter, module x (`teeth` + 2), so module 1.5 with 20 teeth is 33 - give both, and change them with `teeth` to keep the module. `gearPressureAngle` (default 20) and `gearBacklash` (play of the pair in mm, default 0.2, half taken off each gear) set the rest. `gearType` is `spur`, `helical`, `herringbone`, `bevel`, `internal` or `rack`: `herringbone` is two helical halves turning opposite ways (centres itself on its shaft, no axial thrust; same `helixAngle` and `helixQuality` as `helical`); `internal` is a ring gear with its teeth pointing in, the outer wheel of a planetary set - its width and depth are its outside, module x (teeth + 2.5) + 2 x `gearRim` (the rim round the teeth, default 3), and a pinion of the same module runs inside it at module x (teeth - pinion teeth) / 2; `rack` is a bar along x with its teeth towards +z, width teeth x pi x module so racks line up end to end, depth the bar's thickness (free above the teeth plus 0.5), and a gear rolls on it with its centre its teeth x module / 2 in front of the pitch line, a module behind the tips. Ring gear and rack take involute or round teeth, never simple ones, and have no centre hole. A `hirth` is a Hirth joint: a disc with V-shaped teeth running out from the centre (`teeth`, 6 to 90, default 24), `toothSize` their height at the rim (default right-angled teeth, up to the whole `height`, the roots then touching the bottom at the rim), `centerHoleSize` the bore (default 10, 0 for none), `height` the whole height with the crests on top; `hirthSteepFlank` (45 to 90, 90 a straight step) gives saw teeth like a ratchet, one flank that steep and the other gentle, and `hirthReverse: true` puts the steep flank on the other side (`hirthSteepFlank: 0` makes the teeth symmetric again); a copy turned 180 degrees about x (`rotationX: 180`) and standing `height - toothSize` higher locks into it at every tooth, saw teeth too. A `pulley` is a GT2 timing belt pulley for a 2 mm GT2 belt: `teeth` (10 to 200, default 20) set its size - the outside diameter is teeth x 2 / pi - 0.508 mm, 12.22 for 20 teeth - with the GT2 groove made of arcs; from the bottom up a flange, the toothed band `pulleyBeltWidth` wide (default 7 for a 6 mm belt, about 11 for 10 mm), a flange, and the hub; `pulleyFlange` is each flange's thickness (default 1, 0 for none), `pulleyFlangeRise` how far the flanges reach past the teeth (default 1.5), `pulleyHubHeight` and `pulleyHubDiameter` the hub on top (default 6 and 12, height 0 for none), `centerHoleSize` the bore (default 5); width, depth and height follow from these and are not set directly, and for a set screw a hole cylinder goes through the hub. It is an exact body. A `knurl` with `knurlPattern: "round"` has its straight grooves and ridges as a smooth wave of arcs - a grip for a knob whose number of grooves (`knurlCount`), depth and end chamfer are free, unlike a gear's. `gearProfile: "round"` gives round teeth made of arcs instead, like Tinkercad's Useful gear - forgiving on small printed gears and a smooth grip on a knob; they stand lower, so a round gear's outside diameter is module x (`teeth` + 1.2), and round gears mesh with round ones of the same module (no pressure angle, backlash as above). Two gears mesh with the same module and pressure angle at a centre distance of module x (teeth1 + teeth2) / 2 between their centres; for helical gears `helixAngle` is then the true helix angle, and a meshing pair takes the same angle with opposite signs. A `bevel` gear takes `bevelHelixAngle` (default 0) to turn its teeth while they taper, a spiral bevel gear, which stays a triangle mesh. A ring gear (`internal`) and a `rack` take `ringRackHelixAngle` (-45 to 45, default 0 for straight teeth, #1627) to run with a helical gear: give them the same angle as that gear, not the opposite one; `ringRackHerringbone: true` turns their teeth back at half the height, for a herringbone gear of the same angle. The rack keeps its length, its teeth cut off square at both ends; both are exact bodies, a ring gear only on a round footprint, with `helixQuality` for how finely its turn is drawn. A `slot` (the capsule) can have one end smaller than the other, a belt guard round two pulleys: `slotEndRatio` is the small end's diameter as a share of the large one (0.1 to 1, default 1 for two equal ends). The large end sits at the start of the long side (-x, or -z when standing), its diameter is the short side, the small end touches the far end, and the sides run as tangents to both, so the centre distance is the long side less both radii. It stays an exact body. Every shape except gear, hirth, pulley, thread, spring, gridfinity, hinge, pyramid, bentTube, loft, teardrop, counterbore, countersink, finishingWasher and ruler can be tapered through `taperTopWidth`, `taperTopDepth`, `taperBottomWidth` and `taperBottomDepth`, and twisted or leaned through `extrudeTwist`, `extrudeTopOffsetX` and `extrudeTopOffsetZ`; naming one value of a face pins the other one as it stands.
+- `layerling_create_shape`: create any shape the editor has a tile for - `box`, `cube`, `cylinder`, `polygon`, `sphere`, `cone`, `pyramid`, `wedge`, `roundRoof`, `halfSphere`, `paraboloid`, `curvedCone` (a cone whose side bends: `curvedConeTop` the top as a share of the bottom, `curvedConeBend` -1 inward to a trumpet, 1 outward to a dome), `torus`, `tube`, `loft`, `text`, `thread`, `spring`, `gridfinity`, `gear`, `hirth`, `pulley`, `finishingWasher`, the enclosure parts `boxGenerator` (a box or its lid from settings: `boxShape` rectangle, round or polygon, `boxWall`, `boxFloor`, `boxColumns` and `boxRows` for fixed compartments, `boxPart` box, lid or latch (the clip), `boxLidStyle` restOn, overlap or plug, `boxFit`, `boxLatches` clips per side with `boxLatchSides`, `boxLatchWidth` and `boxLatchGrip`; make one shape per part with the same settings), `screwBoss` (a post with a hole: `screwBossFastener` insert, selfTapping or custom, `screwBossSize` M3, #4-40, ST2.9 ..., optional `screwBossGussets`), `snapFit` (a cantilever hook and its catch: `snapFitPart` both, hook or catch, `snapFitUndercut`, `snapFitRetainAngle` 90 holds for good, 45 comes apart) and `rib` (`ribStyle` straight or gusset; `ribFoot: true` stands it on a thin, wider foot for more hold on the bed, `depth` then the foot's width, `ribThickness` the rib's and `ribFootThickness` the foot's; `ribFootShape: "oval"` makes the foot an ellipse without corners, just long enough that the rib's ends still stand on it, `width` then the ellipse's length and the rib inside it shorter) - or a `sketch` extrusion; a `sketch` with `stroke: { width, align, join, cap }` is built as a frame of that width round its outline (align `center`, `inside` or `outside`), as the editor's Stroke does, or with align `grow` as the area widened by that width. Size and everything beyond it are optional and fall back to what the editor uses when the same shape is placed by hand. A `thread` is a rod, a screw, a nut or a tapped hole, set through `threadRole`; its width and depth follow `threadDiameter` and are not given separately. `threadHead` is a screw's head (`cylinder`, `countersunk`, `hex`, `square`, `flange`, `wing`, `knob`) and a nut's shape (`hex`, `square`, `flange`, `wing`, `knob`); a wing or knob prints lying flat and is turned by hand. `threadCollarHeight` puts a round collar between a screw's head and its thread (not under a countersunk head), a spacer under a star knob or a shoulder under a head, or on a nut's top face; `threadCollarDiameter` sets its width (twice the thread by default, always inside the head or nut), and the thread keeps its length (a nut its body). For a standard size pass `threadSize` with its name from the editor's size menu - `M6`, `1/4"-20 UNC`, `G1/2`, `1/2" NPT` - instead of `threadDiameter` and `threadPitch`; a lead screw with several threads side by side takes `threadStarts` (T8x8: `threadDiameter` 8, `threadPitch` 2, `threadStarts` 4, `threadProfile` `trapezoidal`; a size sets it back to 1); an NPT size is tapered (`threadTaper` true: 1 in 16 on the diameter, which is the wide end's; a rod or screw narrows towards its tip at the top, a nut or tapped hole widens towards its mouth at the top), every other size straight, and `threadTaper` tapers any thread; a `settings` block read back with all three still works, a diameter or pitch that does not match the size is refused. `threadClearance` gives nuts and tapped holes room (default 0.2 mm); `threadBoltClearance` makes a rod or screw that much thinner in diameter (default 0), for a printed bolt that has to go into a metal nut. `threadProfile` `custom` is a symmetric trapezoid you shape yourself: `threadFlankAngle` (10 to 90 degrees between the two flanks, default 60) and `threadDepth` (mm, outer minus core radius; the core diameter is `threadDiameter` minus twice that), for example 90 degrees and a depth of 0.4 x the pitch for a thread that prints without supports. `threadAxialClearance` (default 0, at most a fifth of the pitch) gives nuts and tapped holes play along the axis: each tooth of the part gets that much thinner while the diameter stays, so a printed thread can turn freely without rattling sideways - try `threadClearance` 0.2 with `threadAxialClearance` 0.2. A `spring` winds right-hand like a usual compression spring; `springHand: "left"` winds it the other way. `springForm: "flat"` makes it a flat spring instead (#1076): a band running in waves across the plate, printed lying down - `width` is its length, `depth` how far the waves reach, `height` its thickness (a new one is 60 x 16 x 4 unless sizes are given; switching an existing spring keeps its size, so pass the new sizes with it). `springPattern` is `round` (default), `zigzag` or `square`, `springEnds` `eye` (default, a ring with a hole at each end), `tab` or `none`; `springTurns` counts its bends and `springWire` is the band width. It is an exact body. A G size is a parallel Whitworth pipe thread (BSPP, ISO 228-1, as on fittings for water, gas, hydraulics and pneumatics; G1 is 33.249 mm across with 11 threads per inch) and turns a `v` profile into `whitworth`, the 55 degree profile with rounded crest and root; an M, UNC or UNF size turns `whitworth` back into `v`. `PCO 1881` is the 28 mm neck of most water and soda bottles (27.4 mm across, pitch 2.7, #1079): it sets `threadProfile` `custom` with `threadDepth` 1.6 and `threadFlankAngle` 30 unless the call gives them; make the neck a `rod` and the cap a `nut`, or a `bore` taken out of a cylinder. `S60x6 (IBC)` is the outlet thread of IBC containers (DIN 6063-1, KS 60: 60 mm across, pitch 6, core 54; #1094) and sets `custom` with `threadDepth` 3 and `threadFlankAngle` 30 the same way; its real flanks are unequal, the profile has two equal ones. A cylinder without `sides` picks its own side count from the diameter, the way the editor does. A `teardrop` is the cross-section of a horizontal hole that prints without supports: `width` is the diameter of its round part, `depth` its length along the hole and `height` the full height up to the tip (about 1.207 x width gives the usual 90 degree tip; the editor's tip angle is derived from it). A `port` is the opening for a USB, HDMI, DisplayPort or RJ45 socket in a box wall, lying on its side like the teardrop and a hole from the start: `portPreset` (`usbC`, `usbCPlug`, `microUsb`, `usbA`, `hdmi`, `miniHdmi`, `microHdmi`, `displayPort`, `miniDisplayPort`, `rj45`) gives the socket's size from data sheets with a little room, and `portClearance` (0 to 2 mm, #1098) adds that much more on every side, the corners rounder by it; otherwise `width` and `height` are the opening seen from the front, `cornerFillet` its corner radius, `portProfile` cuts the lower corners as on HDMI or DisplayPort and `depth` is how far it reaches through the wall. A `tube` with `washer` (`M1.6` to `M30`) is that screw size's washer to ISO 7089 (M5: 10 mm across, 5.3 mm bore, 1 mm thick). A `counterbore`, `countersink` or `doubleCountersink` with `screwSize` (`M2` to `M30`, a countersink up to `M20` and the inch sizes `#2` to `#14`) takes that screw's hole: shaft as the ISO 273 medium clearance hole (M5 5.5 mm), a counterbore's head to DIN 974-1 (M5 10 mm, as deep as the diameter plus 0.4), a countersink's to ISO 15065 at 90 degrees (M5 10.4 mm); an inch size is ASME B18.6.1 at 82 degrees, which are also the Australian gauges (#6: head 7.09 mm, shaft 3.9 mm). A screw hole's `height` is its whole length. Socket head cap screws are sold by the length under the head, so a counterbore for one takes `height` = that length plus `screwHoleHeadDepth` (M3 x 12 with the 3.2 mm pocket: 15.2), as the counterbore's field Screw length does (#1670); countersunk screws are measured with the head, so a countersink's `height` is the screw's length. A `finishingWasher` is the domed washer (rosette) under a countersunk screw (#1131): flat underneath, a dome rising from a low rim to the seat, a cone of `screwHoleAngle` (90 default) `screwHoleHeadDepth` deep for the head, and the bore `screwHoleShaft`; `width` is its outer diameter (it stays round), `height` the whole height. With `screwSize` (`M2` to `M20`) it takes that screw's measures (M3 10.3 x 2.95 mm, M6 16.6 x 4.5 mm). It is an exact body. A `polygon` with `nut` (`M2` to `M30`) is the pocket for that ISO 4032 hex nut, 0.4 mm wider across flats (`width`) and higher than the nut; make it a `hole`. A `counterbore` (round head pocket, `screwHoleHeadDepth`) or `countersink` (cone, `screwHoleAngle`, 90 for a countersunk screw) is a cutter for a screw head: `width` is the head diameter, `screwHoleShaft` the shaft diameter, `height` the whole length, head end on top; set `hole` and let its top end a little above the surface. A blind hole can end in a drill point (Discussion #621): `drillPointAngle` (60 to 150, 118 for a common twist drill) on a `cylinder` set as `hole`, a `counterbore` or a `countersink` puts the cone of the drill's tip below its bottom, as wide as the hole or the shaft; the `height` stays the depth to the shoulder, as in a drawing, and the tip reaches (diameter / 2) / tan(angle / 2) further down, so a hole 10 deep and 5 wide at 118 ends 11.5 below its top. `drillPointAngle` 0 makes the bottom flat again. `screwHoleSlot` true on a `counterbore`, `countersink` or `doubleCountersink` makes it a slotted hole for lining a part up (#1531): the shorter of `width` and `depth` is the head diameter, the difference the slot's length along the longer one (width 14, depth 6.6: an M3 countersink with a 7.4 mm slot along x); `screwHoleRecess` on a `countersink` or `doubleCountersink` sinks the head that many mm below the face with a straight pocket as wide as the head above the cone (#1531); it has no drill point. `screwHoleChamfer` on a `counterbore` puts a 45-degree chamfer that many mm deep on the rim of the pocket (#1632), opening outside the head diameter so the head still fits; it stays shallower than the pocket. A `doubleCountersink` is a hole chamfered on both faces (#392): `width` is the head diameter at both ends, `screwHoleShaft` the shaft between the two cones, `screwHoleAngle` the cone angle (90 default), `height` the whole length; if two full cones do not fit, they meet in the middle at that angle and the shaft stays wider than set. Push it through a part as a `hole`. A `hinge` is a print-in-place hinge lying open flat: `width` is its length along the axis, `depth` both leaves together, `height` the knuckle diameter; `hingeKnuckles` (odd, default 5), `hingePinDiameter`, `hingeLeafThickness` and `hingeClearance` (default 0.4 mm, raise it if a printer fuses the parts) set the rest, and it prints in one piece; `hingePinless: true` leaves the printed pin out and runs the bore through every knuckle, for a pin of your own; `hingeAngle` (-180 to 180, default 0) folds the second leaf up about the pin, 0 lying flat, 180 closed, below 0 folded down past lying flat. `hingeStyle: "liftOff"` makes a lift-off hinge: two knuckles, the pin on the lower one, the upper one a sleeve that comes off it. `hingeStyle: "snap"` makes a snap-on hinge (Discussion #1520): one leaf's knuckles carry the pin, the other's are clips open on top (the side facing the other leaf when closed), narrower than the pin by `hingeSnapGrip` (default 0.3 mm) with a 45 degree lead-in; separate the parts, print both halves flat without supports, then press the clip half onto the pin, closed, until it clicks. `hingeScrewHoles` (0 to 6 per leaf) adds screw holes with `hingeScrewDiameter`, `hingeScrewSpacing` (along the axis) and `hingeScrewAcross` (centre to centre across both leaves), countersunk unless `hingeScrewHead` says `straight`, `nut` (hexagonal nut pockets, their size by `hingeNutWidth`) or `countersunkNut`; `hingeCornerRadius` rounds the leaves' outer corners; `hingeLeafStyle: "fingers"` gives each knuckle its own finger instead, the two sides alternating like combs, to fold all the way round and to join to a box and its lid; `hingeLeafStyle: "raised"` lifts the second leaf so that, closed, it lies flat on the first with the clearance between, and the hinge folds well past lying flat (it prints with supports under that leaf). A `gridfinity` is a bin or a baseplate for the Gridfinity storage system, to the published measures so it fits parts printed from other designs: `gridfinityType` `bin` (default) or `baseplate`, or `tray` (#837), a tray of any size with a flat bottom and no feet, lip or magnet holes: its `width` and `depth` are free in mm (10 to 252) and its `height` too (3 to 140), kept as given (a new one is 80 x 40 x 20), and the bin's settings below apply to it except the lip, the lip chamfer, the magnets and the half-size grid; its floor starts at 1.2 mm, it takes as many compartments as leave each at least 6 mm wide (up to 24 along a side and 40 in all), and its dividers and label shelves run up to its top. A bin's or baseplate's size is whole grid units of 42 mm, and any `width`, `depth` or `height` is rounded to them: a bin is 42 x units - 0.5 across and deep (41.5, 83.5 ... up to 6 units) and 7 mm per height unit (up to 20) plus 4.4 for the stacking lip (a 3-unit bin is 25.4 tall); a baseplate is 42 x units across and deep, up to 6 units, or 12 with `gridfinityLargePlate` (default false, for print beds over 256 mm), plus its padding, and 5 tall. `gridfinitySwallowtail` (default false) puts a baseplate on a 2.4 mm floor, 7.4 mm tall, with half a bow-tie pocket under each side without padding, so two plates side by side make whole pockets across the seam; `gridfinityKeys: true` on create or update lays out its keys in front of it, one for each pocket at its back and right, returned as parts (not for an outline plate); `gridfinitySwallowtailClearance` (mm, 0 to 0.15, default 0.05) is how much smaller than its pocket each key is on every side, raised if printed keys jam or break. A baseplate given `gridfinityOutline` (points `{ x, z }` in mm in its own frame) fills that outline instead: whole 42 mm cells inside it get sockets, at most 6 across and 6 deep (12 with `gridfinityLargePlate`), the rest is solid, and its box is the outline's bounds, at most 334 mm a side (586 mm with `gridfinityLargePlate`) and at least 10 mm; an empty list takes the outline away. On a bin, `gridfinityLip` (default true) is the stacking lip and `gridfinityMagnets` (default false) adds holes for 6 x 2 mm magnets under each foot; a baseplate has none. `gridfinityHalfGrid` (default false) puts a bin on a half-size grid: width and depth count cells of 21 mm (21 x units - 0.5, up to 12 units), each with its own foot, four to an ordinary baseplate's socket; with magnets each foot gets one hole. A bin of 3 height units or more takes label shelves along its inner walls (their top 0.85 mm below 7 mm per height unit, clear of the feet of a bin stacked on the lip): `gridfinityLabelBack`, `gridfinityLabelFront`, `gridfinityLabelLeft` and `gridfinityLabelRight` (default false, any together; where two meet they join), each with its own width, length and offset, as in `gridfinityLabelBackWidth` (mm out from the wall, default 14, at most about 17 in a bin of 3 units), `gridfinityLabelBackLength` (0, the default, runs it from wall to wall) and `gridfinityLabelBackOffset` (moves a set length along its wall from the middle; positive is +x on the back and front walls and +z on the sides), and likewise for Front, Left and Right; and `gridfinityLabelCorner` `round` (default) or `chamfer` with `gridfinityLabelCornerSize` (default 2, 0 for sharp corners) for the corners where a shelf meets a wall or another shelf. Any bin of 2 height units or more takes finger scoops, the floor rising along a quarter circle into the wall: `gridfinityScoopBack`, `gridfinityScoopFront`, `gridfinityScoopLeft` and `gridfinityScoopRight` (default false, any together), with one `gridfinityScoopRadius` (mm, at least 3.5; unset, it is half the height from the floor up to the lip's support, or to the top without the lip: 6.7 in a bin of 3 units with the lip and the 0.95 mm wall); every floor edge of the bin is then rounded as much as its inner corners (2.8 mm with the 0.95 mm wall). `gridfinityFloorHeight` (mm from the underside, default 5.95) raises the floor of a bin, solid up to it, for a blank to cut shapes into: with the lip a bin still stacks on it up to the lip's support (19.35 in a bin of 3 units with the 0.95 mm wall), and from the lip's top up (25.4 for 3 units) it fills the lip too, a solid block with a flat top; between the two it is built at the highest floor a bin still stacks on; without the lip, at most the top; scoops start on it and shelves can reach less far out above it; both are left out when it leaves them no room. `gridfinityOpenBack`, `gridfinityOpenFront`, `gridfinityOpenLeft` and `gridfinityOpenRight` (default false, any together) take away that side's wall and lip above the floor; the walls beside it run out to the outline and end square, so open bins side by side make one continuous run, the floor runs flat to the edge, and a shelf or scoop on an open side is not built, nor a compartment label. `gridfinityOpenings` opens a side switched open only partly: one entry per side with `side`, `depth` (mm down from the lip's top, at least 2), `width` (mm along the side, at least 5), `align` (`start`, `middle` by default, or `end`) and `distance` (mm from that end); without an entry, at the whole width down to the floor (each within 0.5 mm), or where the side's straight part is shorter than 5 mm, the side is open in full, and anything less cuts a notch out of its wall and lip, which keep their rounded corners; shelves, compartment labels and scoops stay off that side, and a bin built solid by its wall takes no notch. `gridfinityOpeningCorner` (`round` by default or `chamfer`) and `gridfinityOpeningCornerSize` (mm, 0 to 10, default 0 for square) round or chamfer every notch's two top and two bottom corners seen from outside the wall; each corner takes at most what the notch and the wall beside it leave, the top ones first, and up to 0.5 mm less where it would end just beside an edge of the wall, to keep clear of it; under 0.5 mm it stays square, a notch across the whole side has no top corners, and an end run out to the outline beside a side open in full has none. `gridfinityLipChamfer` (a bin with the lip, mm, 0 to 1, default 0 for the sharp top the specification draws) chamfers the lip's top edge as the edge tool's chamfer of that size would, down the outer wall and down the slope a stacked bin rests on; the height setting and how high bins stack stay as they are, and the top comes down by 0.71 x the chamfer. `gridfinityWallThickness` (a bin, mm, default 0.95, from 0.8 up to where the walls meet) sets the wall in from an outside that never changes, so the bin still fits and stacks; over 1.75 mm with the lip the wall stops at a ledge 0.85 mm under 7 mm per height unit, clear of a stacked bin's feet, a wall that leaves less than 1 mm inside builds the bin solid, and scoops, shelves and compartments that no longer have room are left out or fewer. `gridfinityPaddingBack`, `gridfinityPaddingFront`, `gridfinityPaddingLeft` and `gridfinityPaddingRight` (baseplate only, mm, default 0, at most 41) add a solid border at the plate's height outside the grid, so the plate fills a drawer that is not whole units; width and depth are the whole plate with its padding, and a padding given without width and depth keeps the units. `gridfinityCornerRadius` (baseplate only, mm, 0 to 4, default 4) sets the radius of the plate's four outer corners, 4 as the specification draws them, down to 0 for a drawer's square corners; the sockets keep theirs, so bins fit as before. `gridfinityBinCornerRadius` (bin only, mm, 0 to 3.75, default 3.75) sets the radius of a bin's outer corners above its feet, down to 0 so bins side by side in a drawer leave only their 0.5 mm gaps where four meet; the feet, the inside and the lip's slopes keep their rounding, and the wall's first 0.5 mm over the feet keeps 3.75, so the bin fits and stacks as before. `gridfinityCompartmentsX` and `gridfinityCompartmentsZ` (default 1) divide a bin of 2 height units or more into compartments with dividers of the full height (their top 0.85 mm below 7 mm per height unit, like the shelves), up to 4 per grid unit each way and 40 in all, each compartment at least 6 mm wide; `gridfinityDividerThickness` is mm, 0.8 to 3 (default 1.2), and `gridfinityDividerPositionsX`/`gridfinityDividerPositionsZ` place the dividers in mm from the inside of the left or back wall to each divider's middle (unset or `[]`, evenly spaced; once set, that axis keeps them in mm when the bin is resized; giving a count puts that axis's dividers back evenly spaced unless its positions are given in the same call). Scoops repeat in every compartment against the wall or divider on their side, made smaller in a narrow compartment and left out where even 3.5 mm does not fit. A divided bin of 3 height units or more takes `gridfinityCompartmentLabels` instead of the wall shelves: a list of `{ column, row, side, length, align, width, text }`, one per compartment (column 0 the left, row 0 the back; side `back`, `front`, `left` or `right`, the wall or divider it stands against; length 10 to 100 per cent of that side; align `start`, `middle` or `end`; width mm, default 14; text, see below), with the shelves' corner settings. A shelf can carry a text raised 0.4 mm on its top as part of the bin: `gridfinityLabelBackText`, `gridfinityLabelFrontText`, `gridfinityLabelLeftText`, `gridfinityLabelRightText` or a compartment label's `text`, one line of up to 24 characters in `gridfinityLabelFont` (a built-in font, default Multilanguage, or a font of one's own by its name or id), fitted as large as the shelf's top lets it, or with capitals `gridfinityLabelTextSize` mm high on every shelf where it lets them (0, the default, for as large as each lets them); a text whose capitals would be under 3 mm is left out, and a tray has none. `gridfinityLabelColor` (#rrggbb, an empty string for the bin's own colour) gives the letters a colour of their own: the bin stays one body, a 3MF carries the letters' faces in that colour, painted for OrcaSlicer and PrusaSlicer 2.9 too, and an OBJ their points. A bin is an exact body, so the edge tool and STEP work on it. A `loft` ("Übergang" in German) joins an outline at the bottom to another at the top with a straight-ruled wall - a hose adapter, a square fan onto a round duct, a stand: `loftBottomOutline` and `loftTopOutline` are `round` (circle or ellipse), `rectangle` (corners rounded by `loftBottomCorner`/`loftTopCorner`) or `polygon` (`loftBottomSides`/`loftTopSides`), `loftBottomWidth`/`loftBottomDepth` and `loftTopWidth`/`loftTopDepth` size the ends, `loftOffsetX`/`loftOffsetZ` move the top sideways (the bottom stays put), and `loftWall` above 0 makes it a tube open at both ends; `loftTopWall` gives the top end a wall of its own (3 mm at the bottom and 1 mm at the top, say; left out it follows `loftWall`, and sections in between take the wall evenly by their height). `loftSections` (#1034, up to 12) puts sections between the ends, each `{ at, outline, width, depth }` with `at` a share of the height (0.01 to 0.99) and `corner`, `sides`, `offsetX`, `offsetZ` as needed, and the body goes through all of them: `loftThrough` `smooth` (default, one curved surface) or `straight` (flat walls from section to section); twist, tilt and `loftSmooth` are left aside while there are sections, and `[]` removes them. `loftSmooth` (0 to 1, default 0) lets the sides follow an S-curve between the ends instead of a straight line, for a hose adapter that flares smoothly; `loftSegments` (16 to 360, default 96) sets how many straight pieces a full circle or rounded corner is drawn with in the view and the exports; `loftTwist` turns the section evenly from bottom to top about the vertical (degrees, up to 360 either way), and `loftTiltX`/`loftTiltZ` tilt the top end (degrees, up to 45: positive raises its front +z edge / its right +x side); the sections tilt evenly on the way up and the highest point stays at the height. Its width and depth are what both ends need together and are not given separately; `settings` reports the ends as the body shows them. It is an exact body, so the edge tool and STEP work on it. A `gear` gets involute teeth that mesh (`gearProfile: "involute"`, the default for a new gear; `"simple"` is the plain straight teeth older designs have, set by `toothSize` and `toothWidth`). An involute gear is set like a gear generator: its `width` and `depth` are its outside diameter, module x (`teeth` + 2), so module 1.5 with 20 teeth is 33 - give both, and change them with `teeth` to keep the module. `gearPressureAngle` (default 20) and `gearBacklash` (play of the pair in mm, default 0.2, half taken off each gear) set the rest. `gearType` is `spur`, `helical`, `herringbone`, `bevel`, `internal` or `rack`: `herringbone` is two helical halves turning opposite ways (centres itself on its shaft, no axial thrust; same `helixAngle` and `helixQuality` as `helical`); `internal` is a ring gear with its teeth pointing in, the outer wheel of a planetary set - its width and depth are its outside, module x (teeth + 2.5) + 2 x `gearRim` (the rim round the teeth, default 3), and a pinion of the same module runs inside it at module x (teeth - pinion teeth) / 2; `rack` is a bar along x with its teeth towards +z, width teeth x pi x module so racks line up end to end, depth the bar's thickness (free above the teeth plus 0.5), and a gear rolls on it with its centre its teeth x module / 2 in front of the pitch line, a module behind the tips. Ring gear and rack take involute or round teeth, never simple ones, and have no centre hole. A `hirth` is a Hirth joint: a disc with V-shaped teeth running out from the centre (`teeth`, 6 to 90, default 24), `toothSize` their height at the rim (default right-angled teeth, up to the whole `height`, the roots then touching the bottom at the rim), `centerHoleSize` the bore (default 10, 0 for none), `height` the whole height with the crests on top; `hirthSteepFlank` (45 to 90, 90 a straight step) gives saw teeth like a ratchet, one flank that steep and the other gentle, and `hirthReverse: true` puts the steep flank on the other side (`hirthSteepFlank: 0` makes the teeth symmetric again); a copy turned 180 degrees about x (`rotationX: 180`) and standing `height - toothSize` higher locks into it at every tooth, saw teeth too. A `pulley` is a GT2 timing belt pulley for a 2 mm GT2 belt: `teeth` (10 to 200, default 20) set its size - the outside diameter is teeth x 2 / pi - 0.508 mm, 12.22 for 20 teeth - with the GT2 groove made of arcs; from the bottom up a flange, the toothed band `pulleyBeltWidth` wide (default 7 for a 6 mm belt, about 11 for 10 mm), a flange, and the hub; `pulleyFlange` is each flange's thickness (default 1, 0 for none), `pulleyFlangeRise` how far the flanges reach past the teeth (default 1.5), `pulleyHubHeight` and `pulleyHubDiameter` the hub on top (default 6 and 12, height 0 for none), `centerHoleSize` the bore (default 5); width, depth and height follow from these and are not set directly, and for a set screw a hole cylinder goes through the hub. It is an exact body. A `knurl` with `knurlPattern: "round"` has its straight grooves and ridges as a smooth wave of arcs - a grip for a knob whose number of grooves (`knurlCount`), depth and end chamfer are free, unlike a gear's. `gearProfile: "round"` gives round teeth made of arcs instead, like Tinkercad's Useful gear - forgiving on small printed gears and a smooth grip on a knob; they stand lower, so a round gear's outside diameter is module x (`teeth` + 1.2), and round gears mesh with round ones of the same module (no pressure angle, backlash as above). Two gears mesh with the same module and pressure angle at a centre distance of module x (teeth1 + teeth2) / 2 between their centres; for helical gears `helixAngle` is then the true helix angle, and a meshing pair takes the same angle with opposite signs. A `bevel` gear takes `bevelHelixAngle` (default 0) to turn its teeth while they taper, a spiral bevel gear, which stays a triangle mesh. A ring gear (`internal`) and a `rack` take `ringRackHelixAngle` (-45 to 45, default 0 for straight teeth, #1627) to run with a helical gear: give them the same angle as that gear, not the opposite one; `ringRackHerringbone: true` turns their teeth back at half the height, for a herringbone gear of the same angle. The rack keeps its length, its teeth cut off square at both ends; both are exact bodies, a ring gear only on a round footprint, with `helixQuality` for how finely its turn is drawn. A `slot` (the capsule) can have one end smaller than the other, a belt guard round two pulleys: `slotEndRatio` is the small end's diameter as a share of the large one (0.1 to 1, default 1 for two equal ends). The large end sits at the start of the long side (-x, or -z when standing), its diameter is the short side, the small end touches the far end, and the sides run as tangents to both, so the centre distance is the long side less both radii. It stays an exact body. Every shape except gear, hirth, pulley, thread, spring, gridfinity, hinge, pyramid, bentTube, loft, teardrop, counterbore, countersink, finishingWasher and ruler can be tapered through `taperTopWidth`, `taperTopDepth`, `taperBottomWidth` and `taperBottomDepth`, and twisted or leaned through `extrudeTwist`, `extrudeTopOffsetX` and `extrudeTopOffsetZ`; naming one value of a face pins the other one as it stands.
- `layerling_import_file`: import a file as the import window does (STL, OBJ, 3MF, STEP, SVG, DXF or a ZIP of them), content as `text` or `base64`; a DXF (#774) comes in as parts in millimetres, 4 mm high: every closed outline a sketch body, every hole in it a loose hole beside it (a round one a cylinder hole, others sketch holes) to move and size like any hole (arcs kept as true arcs, text, dimensions, hatches and open outlines left out); an SVG with `keepPagePosition: true` keeps its place on its page (viewBox), so files of one page line up; `svgWidth` (mm) scales an SVG or a picture to that width on the way in; a coloured OBJ (vertex colours, or materials with `mtl`) or 3MF (its own colours, or the filaments of a Bambu Studio, OrcaSlicer or PrusaSlicer project) comes in as one body per colour; a 3MF with several objects comes in as one body per object (and per colour within it). Slicer modifiers, negative volumes and support blockers are left out. An SVG comes in as an extruded sketch body (4 mm high, reading from above as in the drawing) whose fill `layerling_update_object` changes with `stroke` and `silhouette`; only one with more than 2500 lines and curves comes in as a fixed mesh. layerling is made first of all for exact CAD bodies: an import that brings in a mesh of 400,000 triangles or more, or takes the design's STL, OBJ and 3MF meshes to a million together, returns `warning` (#1652), since meshes this large make the editor slow and saving slow; simplify them with `layerling_simplify_mesh` or build simple parts from the editor's shapes.
- `layerling_import_mesh`: import STL-style mesh data into the editor.
- `layerling_add_font`: add a font of one's own for texts and the letters of Gridfinity bins from a TrueType, OpenType or WOFF file as `base64` (with its `fileName`); WOFF2 and .ttc collections are refused. It returns the font's `id` (`custom:...`) and `name`; use either as `font` on a text or as `gridfinityLabelFont` on a Gridfinity bin; `useOnSelection` puts it on the selected ones. The font stays in the browser the editor runs in; a saved design keeps only the outlines of the letters its texts and bins use, so it opens anywhere, and new letters need the font there too. Check a font's licence before passing a design on. Installed system fonts can only be picked by hand in the editor (Chrome and Edge).
diff --git a/.claude/skills/layerling-mcp-skill/SKILL.md b/.claude/skills/layerling-mcp-skill/SKILL.md
index b5768cd6b1..4de0ec05c6 100644
--- a/.claude/skills/layerling-mcp-skill/SKILL.md
+++ b/.claude/skills/layerling-mcp-skill/SKILL.md
@@ -66,7 +66,7 @@ Useful tools:
- `layerling_rename_project`: give the project a name (`name`, at most 80 characters), as the pencil beside the project name does, so a design is easy to find in the project list later. `layerling_list_editors` and `layerling_read_scene` report the project's name: check it before changing a design, so the shapes land in the right project.
- `layerling_delete_objects`: delete ids in the live editor, or delete the current selection when ids are omitted
- `layerling_move_object`: move an object to another place in the object list (the design's own order): `id`, and `before`, the id it goes in front of (omitted: last). One undo step..
-- `layerling_create_shape`: create any shape the editor has a tile for - `box`, `cube`, `cylinder`, `polygon`, `sphere`, `cone`, `pyramid`, `wedge`, `roundRoof`, `halfSphere`, `paraboloid`, `curvedCone` (a cone whose side bends: `curvedConeTop` the top as a share of the bottom, `curvedConeBend` -1 inward to a trumpet, 1 outward to a dome), `torus`, `tube`, `loft`, `text`, `thread`, `spring`, `gridfinity`, `gear`, `hirth`, `pulley`, `finishingWasher`, the enclosure parts `boxGenerator` (a box or its lid from settings: `boxShape` rectangle, round or polygon, `boxWall`, `boxFloor`, `boxColumns` and `boxRows` for fixed compartments, `boxPart` box or lid, `boxLidStyle` restOn, overlap or plug, `boxFit`; make one shape per part with the same settings), `screwBoss` (a post with a hole: `screwBossFastener` insert, selfTapping or custom, `screwBossSize` M3, #4-40, ST2.9 ..., optional `screwBossGussets`), `snapFit` (a cantilever hook and its catch: `snapFitPart` both, hook or catch, `snapFitUndercut`, `snapFitRetainAngle` 90 holds for good, 45 comes apart) and `rib` (`ribStyle` straight or gusset; `ribFoot: true` stands it on a thin, wider foot for more hold on the bed, `depth` then the foot's width, `ribThickness` the rib's and `ribFootThickness` the foot's; `ribFootShape: "oval"` makes the foot an ellipse without corners, just long enough that the rib's ends still stand on it, `width` then the ellipse's length and the rib inside it shorter) - or a `sketch` extrusion; a `sketch` with `stroke: { width, align, join, cap }` is built as a frame of that width round its outline (align `center`, `inside` or `outside`), as the editor's Stroke does, or with align `grow` as the area widened by that width. Size and everything beyond it are optional and fall back to what the editor uses when the same shape is placed by hand. A `thread` is a rod, a screw, a nut or a tapped hole, set through `threadRole`; its width and depth follow `threadDiameter` and are not given separately. `threadHead` is a screw's head (`cylinder`, `countersunk`, `hex`, `square`, `flange`, `wing`, `knob`) and a nut's shape (`hex`, `square`, `flange`, `wing`, `knob`); a wing or knob prints lying flat and is turned by hand. `threadCollarHeight` puts a round collar between a screw's head and its thread (not under a countersunk head), a spacer under a star knob or a shoulder under a head, or on a nut's top face; `threadCollarDiameter` sets its width (twice the thread by default, always inside the head or nut), and the thread keeps its length (a nut its body). For a standard size pass `threadSize` with its name from the editor's size menu - `M6`, `1/4"-20 UNC`, `G1/2`, `1/2" NPT` - instead of `threadDiameter` and `threadPitch`; a lead screw with several threads side by side takes `threadStarts` (T8x8: `threadDiameter` 8, `threadPitch` 2, `threadStarts` 4, `threadProfile` `trapezoidal`; a size sets it back to 1); an NPT size is tapered (`threadTaper` true: 1 in 16 on the diameter, which is the wide end's; a rod or screw narrows towards its tip at the top, a nut or tapped hole widens towards its mouth at the top), every other size straight, and `threadTaper` tapers any thread; a `settings` block read back with all three still works, a diameter or pitch that does not match the size is refused. `threadClearance` gives nuts and tapped holes room (default 0.2 mm); `threadBoltClearance` makes a rod or screw that much thinner in diameter (default 0), for a printed bolt that has to go into a metal nut. `threadProfile` `custom` is a symmetric trapezoid you shape yourself: `threadFlankAngle` (10 to 90 degrees between the two flanks, default 60) and `threadDepth` (mm, outer minus core radius; the core diameter is `threadDiameter` minus twice that), for example 90 degrees and a depth of 0.4 x the pitch for a thread that prints without supports. `threadAxialClearance` (default 0, at most a fifth of the pitch) gives nuts and tapped holes play along the axis: each tooth of the part gets that much thinner while the diameter stays, so a printed thread can turn freely without rattling sideways - try `threadClearance` 0.2 with `threadAxialClearance` 0.2. A `spring` winds right-hand like a usual compression spring; `springHand: "left"` winds it the other way. `springForm: "flat"` makes it a flat spring instead (#1076): a band running in waves across the plate, printed lying down - `width` is its length, `depth` how far the waves reach, `height` its thickness (a new one is 60 x 16 x 4 unless sizes are given; switching an existing spring keeps its size, so pass the new sizes with it). `springPattern` is `round` (default), `zigzag` or `square`, `springEnds` `eye` (default, a ring with a hole at each end), `tab` or `none`; `springTurns` counts its bends and `springWire` is the band width. It is an exact body. A G size is a parallel Whitworth pipe thread (BSPP, ISO 228-1, as on fittings for water, gas, hydraulics and pneumatics; G1 is 33.249 mm across with 11 threads per inch) and turns a `v` profile into `whitworth`, the 55 degree profile with rounded crest and root; an M, UNC or UNF size turns `whitworth` back into `v`. `PCO 1881` is the 28 mm neck of most water and soda bottles (27.4 mm across, pitch 2.7, #1079): it sets `threadProfile` `custom` with `threadDepth` 1.6 and `threadFlankAngle` 30 unless the call gives them; make the neck a `rod` and the cap a `nut`, or a `bore` taken out of a cylinder. `S60x6 (IBC)` is the outlet thread of IBC containers (DIN 6063-1, KS 60: 60 mm across, pitch 6, core 54; #1094) and sets `custom` with `threadDepth` 3 and `threadFlankAngle` 30 the same way; its real flanks are unequal, the profile has two equal ones. A cylinder without `sides` picks its own side count from the diameter, the way the editor does. A `teardrop` is the cross-section of a horizontal hole that prints without supports: `width` is the diameter of its round part, `depth` its length along the hole and `height` the full height up to the tip (about 1.207 x width gives the usual 90 degree tip; the editor's tip angle is derived from it). A `port` is the opening for a USB, HDMI, DisplayPort or RJ45 socket in a box wall, lying on its side like the teardrop and a hole from the start: `portPreset` (`usbC`, `usbCPlug`, `microUsb`, `usbA`, `hdmi`, `miniHdmi`, `microHdmi`, `displayPort`, `miniDisplayPort`, `rj45`) gives the socket's size from data sheets with a little room, and `portClearance` (0 to 2 mm, #1098) adds that much more on every side, the corners rounder by it; otherwise `width` and `height` are the opening seen from the front, `cornerFillet` its corner radius, `portProfile` cuts the lower corners as on HDMI or DisplayPort and `depth` is how far it reaches through the wall. A `tube` with `washer` (`M1.6` to `M30`) is that screw size's washer to ISO 7089 (M5: 10 mm across, 5.3 mm bore, 1 mm thick). A `counterbore`, `countersink` or `doubleCountersink` with `screwSize` (`M2` to `M30`, a countersink up to `M20` and the inch sizes `#2` to `#14`) takes that screw's hole: shaft as the ISO 273 medium clearance hole (M5 5.5 mm), a counterbore's head to DIN 974-1 (M5 10 mm, as deep as the diameter plus 0.4), a countersink's to ISO 15065 at 90 degrees (M5 10.4 mm); an inch size is ASME B18.6.1 at 82 degrees, which are also the Australian gauges (#6: head 7.09 mm, shaft 3.9 mm). A screw hole's `height` is its whole length. Socket head cap screws are sold by the length under the head, so a counterbore for one takes `height` = that length plus `screwHoleHeadDepth` (M3 x 12 with the 3.2 mm pocket: 15.2), as the counterbore's field Screw length does (#1670); countersunk screws are measured with the head, so a countersink's `height` is the screw's length. A `finishingWasher` is the domed washer (rosette) under a countersunk screw (#1131): flat underneath, a dome rising from a low rim to the seat, a cone of `screwHoleAngle` (90 default) `screwHoleHeadDepth` deep for the head, and the bore `screwHoleShaft`; `width` is its outer diameter (it stays round), `height` the whole height. With `screwSize` (`M2` to `M20`) it takes that screw's measures (M3 10.3 x 2.95 mm, M6 16.6 x 4.5 mm). It is an exact body. A `polygon` with `nut` (`M2` to `M30`) is the pocket for that ISO 4032 hex nut, 0.4 mm wider across flats (`width`) and higher than the nut; make it a `hole`. A `counterbore` (round head pocket, `screwHoleHeadDepth`) or `countersink` (cone, `screwHoleAngle`, 90 for a countersunk screw) is a cutter for a screw head: `width` is the head diameter, `screwHoleShaft` the shaft diameter, `height` the whole length, head end on top; set `hole` and let its top end a little above the surface. A blind hole can end in a drill point (Discussion #621): `drillPointAngle` (60 to 150, 118 for a common twist drill) on a `cylinder` set as `hole`, a `counterbore` or a `countersink` puts the cone of the drill's tip below its bottom, as wide as the hole or the shaft; the `height` stays the depth to the shoulder, as in a drawing, and the tip reaches (diameter / 2) / tan(angle / 2) further down, so a hole 10 deep and 5 wide at 118 ends 11.5 below its top. `drillPointAngle` 0 makes the bottom flat again. `screwHoleSlot` true on a `counterbore`, `countersink` or `doubleCountersink` makes it a slotted hole for lining a part up (#1531): the shorter of `width` and `depth` is the head diameter, the difference the slot's length along the longer one (width 14, depth 6.6: an M3 countersink with a 7.4 mm slot along x); `screwHoleRecess` on a `countersink` or `doubleCountersink` sinks the head that many mm below the face with a straight pocket as wide as the head above the cone (#1531); it has no drill point. `screwHoleChamfer` on a `counterbore` puts a 45-degree chamfer that many mm deep on the rim of the pocket (#1632), opening outside the head diameter so the head still fits; it stays shallower than the pocket. A `doubleCountersink` is a hole chamfered on both faces (#392): `width` is the head diameter at both ends, `screwHoleShaft` the shaft between the two cones, `screwHoleAngle` the cone angle (90 default), `height` the whole length; if two full cones do not fit, they meet in the middle at that angle and the shaft stays wider than set. Push it through a part as a `hole`. A `hinge` is a print-in-place hinge lying open flat: `width` is its length along the axis, `depth` both leaves together, `height` the knuckle diameter; `hingeKnuckles` (odd, default 5), `hingePinDiameter`, `hingeLeafThickness` and `hingeClearance` (default 0.4 mm, raise it if a printer fuses the parts) set the rest, and it prints in one piece; `hingePinless: true` leaves the printed pin out and runs the bore through every knuckle, for a pin of your own; `hingeAngle` (-180 to 180, default 0) folds the second leaf up about the pin, 0 lying flat, 180 closed, below 0 folded down past lying flat. `hingeStyle: "liftOff"` makes a lift-off hinge: two knuckles, the pin on the lower one, the upper one a sleeve that comes off it. `hingeStyle: "snap"` makes a snap-on hinge (Discussion #1520): one leaf's knuckles carry the pin, the other's are clips open on top (the side facing the other leaf when closed), narrower than the pin by `hingeSnapGrip` (default 0.3 mm) with a 45 degree lead-in; separate the parts, print both halves flat without supports, then press the clip half onto the pin, closed, until it clicks. `hingeScrewHoles` (0 to 6 per leaf) adds screw holes with `hingeScrewDiameter`, `hingeScrewSpacing` (along the axis) and `hingeScrewAcross` (centre to centre across both leaves), countersunk unless `hingeScrewHead` says `straight`, `nut` (hexagonal nut pockets, their size by `hingeNutWidth`) or `countersunkNut`; `hingeCornerRadius` rounds the leaves' outer corners; `hingeLeafStyle: "fingers"` gives each knuckle its own finger instead, the two sides alternating like combs, to fold all the way round and to join to a box and its lid; `hingeLeafStyle: "raised"` lifts the second leaf so that, closed, it lies flat on the first with the clearance between, and the hinge folds well past lying flat (it prints with supports under that leaf). A `gridfinity` is a bin or a baseplate for the Gridfinity storage system, to the published measures so it fits parts printed from other designs: `gridfinityType` `bin` (default) or `baseplate`, or `tray` (#837), a tray of any size with a flat bottom and no feet, lip or magnet holes: its `width` and `depth` are free in mm (10 to 252) and its `height` too (3 to 140), kept as given (a new one is 80 x 40 x 20), and the bin's settings below apply to it except the lip, the lip chamfer, the magnets and the half-size grid; its floor starts at 1.2 mm, it takes as many compartments as leave each at least 6 mm wide (up to 24 along a side and 40 in all), and its dividers and label shelves run up to its top. A bin's or baseplate's size is whole grid units of 42 mm, and any `width`, `depth` or `height` is rounded to them: a bin is 42 x units - 0.5 across and deep (41.5, 83.5 ... up to 6 units) and 7 mm per height unit (up to 20) plus 4.4 for the stacking lip (a 3-unit bin is 25.4 tall); a baseplate is 42 x units across and deep, up to 6 units, or 12 with `gridfinityLargePlate` (default false, for print beds over 256 mm), plus its padding, and 5 tall. `gridfinitySwallowtail` (default false) puts a baseplate on a 2.4 mm floor, 7.4 mm tall, with half a bow-tie pocket under each side without padding, so two plates side by side make whole pockets across the seam; `gridfinityKeys: true` on create or update lays out its keys in front of it, one for each pocket at its back and right, returned as parts (not for an outline plate); `gridfinitySwallowtailClearance` (mm, 0 to 0.15, default 0.05) is how much smaller than its pocket each key is on every side, raised if printed keys jam or break. A baseplate given `gridfinityOutline` (points `{ x, z }` in mm in its own frame) fills that outline instead: whole 42 mm cells inside it get sockets, at most 6 across and 6 deep (12 with `gridfinityLargePlate`), the rest is solid, and its box is the outline's bounds, at most 334 mm a side (586 mm with `gridfinityLargePlate`) and at least 10 mm; an empty list takes the outline away. On a bin, `gridfinityLip` (default true) is the stacking lip and `gridfinityMagnets` (default false) adds holes for 6 x 2 mm magnets under each foot; a baseplate has none. `gridfinityHalfGrid` (default false) puts a bin on a half-size grid: width and depth count cells of 21 mm (21 x units - 0.5, up to 12 units), each with its own foot, four to an ordinary baseplate's socket; with magnets each foot gets one hole. A bin of 3 height units or more takes label shelves along its inner walls (their top 0.85 mm below 7 mm per height unit, clear of the feet of a bin stacked on the lip): `gridfinityLabelBack`, `gridfinityLabelFront`, `gridfinityLabelLeft` and `gridfinityLabelRight` (default false, any together; where two meet they join), each with its own width, length and offset, as in `gridfinityLabelBackWidth` (mm out from the wall, default 14, at most about 17 in a bin of 3 units), `gridfinityLabelBackLength` (0, the default, runs it from wall to wall) and `gridfinityLabelBackOffset` (moves a set length along its wall from the middle; positive is +x on the back and front walls and +z on the sides), and likewise for Front, Left and Right; and `gridfinityLabelCorner` `round` (default) or `chamfer` with `gridfinityLabelCornerSize` (default 2, 0 for sharp corners) for the corners where a shelf meets a wall or another shelf. Any bin of 2 height units or more takes finger scoops, the floor rising along a quarter circle into the wall: `gridfinityScoopBack`, `gridfinityScoopFront`, `gridfinityScoopLeft` and `gridfinityScoopRight` (default false, any together), with one `gridfinityScoopRadius` (mm, at least 3.5; unset, it is half the height from the floor up to the lip's support, or to the top without the lip: 6.7 in a bin of 3 units with the lip and the 0.95 mm wall); every floor edge of the bin is then rounded as much as its inner corners (2.8 mm with the 0.95 mm wall). `gridfinityFloorHeight` (mm from the underside, default 5.95) raises the floor of a bin, solid up to it, for a blank to cut shapes into: with the lip a bin still stacks on it up to the lip's support (19.35 in a bin of 3 units with the 0.95 mm wall), and from the lip's top up (25.4 for 3 units) it fills the lip too, a solid block with a flat top; between the two it is built at the highest floor a bin still stacks on; without the lip, at most the top; scoops start on it and shelves can reach less far out above it; both are left out when it leaves them no room. `gridfinityOpenBack`, `gridfinityOpenFront`, `gridfinityOpenLeft` and `gridfinityOpenRight` (default false, any together) take away that side's wall and lip above the floor; the walls beside it run out to the outline and end square, so open bins side by side make one continuous run, the floor runs flat to the edge, and a shelf or scoop on an open side is not built, nor a compartment label. `gridfinityOpenings` opens a side switched open only partly: one entry per side with `side`, `depth` (mm down from the lip's top, at least 2), `width` (mm along the side, at least 5), `align` (`start`, `middle` by default, or `end`) and `distance` (mm from that end); without an entry, at the whole width down to the floor (each within 0.5 mm), or where the side's straight part is shorter than 5 mm, the side is open in full, and anything less cuts a notch out of its wall and lip, which keep their rounded corners; shelves, compartment labels and scoops stay off that side, and a bin built solid by its wall takes no notch. `gridfinityOpeningCorner` (`round` by default or `chamfer`) and `gridfinityOpeningCornerSize` (mm, 0 to 10, default 0 for square) round or chamfer every notch's two top and two bottom corners seen from outside the wall; each corner takes at most what the notch and the wall beside it leave, the top ones first, and up to 0.5 mm less where it would end just beside an edge of the wall, to keep clear of it; under 0.5 mm it stays square, a notch across the whole side has no top corners, and an end run out to the outline beside a side open in full has none. `gridfinityLipChamfer` (a bin with the lip, mm, 0 to 1, default 0 for the sharp top the specification draws) chamfers the lip's top edge as the edge tool's chamfer of that size would, down the outer wall and down the slope a stacked bin rests on; the height setting and how high bins stack stay as they are, and the top comes down by 0.71 x the chamfer. `gridfinityWallThickness` (a bin, mm, default 0.95, from 0.8 up to where the walls meet) sets the wall in from an outside that never changes, so the bin still fits and stacks; over 1.75 mm with the lip the wall stops at a ledge 0.85 mm under 7 mm per height unit, clear of a stacked bin's feet, a wall that leaves less than 1 mm inside builds the bin solid, and scoops, shelves and compartments that no longer have room are left out or fewer. `gridfinityPaddingBack`, `gridfinityPaddingFront`, `gridfinityPaddingLeft` and `gridfinityPaddingRight` (baseplate only, mm, default 0, at most 41) add a solid border at the plate's height outside the grid, so the plate fills a drawer that is not whole units; width and depth are the whole plate with its padding, and a padding given without width and depth keeps the units. `gridfinityCornerRadius` (baseplate only, mm, 0 to 4, default 4) sets the radius of the plate's four outer corners, 4 as the specification draws them, down to 0 for a drawer's square corners; the sockets keep theirs, so bins fit as before. `gridfinityBinCornerRadius` (bin only, mm, 0 to 3.75, default 3.75) sets the radius of a bin's outer corners above its feet, down to 0 so bins side by side in a drawer leave only their 0.5 mm gaps where four meet; the feet, the inside and the lip's slopes keep their rounding, and the wall's first 0.5 mm over the feet keeps 3.75, so the bin fits and stacks as before. `gridfinityCompartmentsX` and `gridfinityCompartmentsZ` (default 1) divide a bin of 2 height units or more into compartments with dividers of the full height (their top 0.85 mm below 7 mm per height unit, like the shelves), up to 4 per grid unit each way and 40 in all, each compartment at least 6 mm wide; `gridfinityDividerThickness` is mm, 0.8 to 3 (default 1.2), and `gridfinityDividerPositionsX`/`gridfinityDividerPositionsZ` place the dividers in mm from the inside of the left or back wall to each divider's middle (unset or `[]`, evenly spaced; once set, that axis keeps them in mm when the bin is resized; giving a count puts that axis's dividers back evenly spaced unless its positions are given in the same call). Scoops repeat in every compartment against the wall or divider on their side, made smaller in a narrow compartment and left out where even 3.5 mm does not fit. A divided bin of 3 height units or more takes `gridfinityCompartmentLabels` instead of the wall shelves: a list of `{ column, row, side, length, align, width, text }`, one per compartment (column 0 the left, row 0 the back; side `back`, `front`, `left` or `right`, the wall or divider it stands against; length 10 to 100 per cent of that side; align `start`, `middle` or `end`; width mm, default 14; text, see below), with the shelves' corner settings. A shelf can carry a text raised 0.4 mm on its top as part of the bin: `gridfinityLabelBackText`, `gridfinityLabelFrontText`, `gridfinityLabelLeftText`, `gridfinityLabelRightText` or a compartment label's `text`, one line of up to 24 characters in `gridfinityLabelFont` (a built-in font, default Multilanguage, or a font of one's own by its name or id), fitted as large as the shelf's top lets it, or with capitals `gridfinityLabelTextSize` mm high on every shelf where it lets them (0, the default, for as large as each lets them); a text whose capitals would be under 3 mm is left out, and a tray has none. `gridfinityLabelColor` (#rrggbb, an empty string for the bin's own colour) gives the letters a colour of their own: the bin stays one body, a 3MF carries the letters' faces in that colour, painted for OrcaSlicer and PrusaSlicer 2.9 too, and an OBJ their points. A bin is an exact body, so the edge tool and STEP work on it. A `loft` ("Übergang" in German) joins an outline at the bottom to another at the top with a straight-ruled wall - a hose adapter, a square fan onto a round duct, a stand: `loftBottomOutline` and `loftTopOutline` are `round` (circle or ellipse), `rectangle` (corners rounded by `loftBottomCorner`/`loftTopCorner`) or `polygon` (`loftBottomSides`/`loftTopSides`), `loftBottomWidth`/`loftBottomDepth` and `loftTopWidth`/`loftTopDepth` size the ends, `loftOffsetX`/`loftOffsetZ` move the top sideways (the bottom stays put), and `loftWall` above 0 makes it a tube open at both ends; `loftTopWall` gives the top end a wall of its own (3 mm at the bottom and 1 mm at the top, say; left out it follows `loftWall`, and sections in between take the wall evenly by their height). `loftSections` (#1034, up to 12) puts sections between the ends, each `{ at, outline, width, depth }` with `at` a share of the height (0.01 to 0.99) and `corner`, `sides`, `offsetX`, `offsetZ` as needed, and the body goes through all of them: `loftThrough` `smooth` (default, one curved surface) or `straight` (flat walls from section to section); twist, tilt and `loftSmooth` are left aside while there are sections, and `[]` removes them. `loftSmooth` (0 to 1, default 0) lets the sides follow an S-curve between the ends instead of a straight line, for a hose adapter that flares smoothly; `loftSegments` (16 to 360, default 96) sets how many straight pieces a full circle or rounded corner is drawn with in the view and the exports; `loftTwist` turns the section evenly from bottom to top about the vertical (degrees, up to 360 either way), and `loftTiltX`/`loftTiltZ` tilt the top end (degrees, up to 45: positive raises its front +z edge / its right +x side); the sections tilt evenly on the way up and the highest point stays at the height. Its width and depth are what both ends need together and are not given separately; `settings` reports the ends as the body shows them. It is an exact body, so the edge tool and STEP work on it. A `gear` gets involute teeth that mesh (`gearProfile: "involute"`, the default for a new gear; `"simple"` is the plain straight teeth older designs have, set by `toothSize` and `toothWidth`). An involute gear is set like a gear generator: its `width` and `depth` are its outside diameter, module x (`teeth` + 2), so module 1.5 with 20 teeth is 33 - give both, and change them with `teeth` to keep the module. `gearPressureAngle` (default 20) and `gearBacklash` (play of the pair in mm, default 0.2, half taken off each gear) set the rest. `gearType` is `spur`, `helical`, `herringbone`, `bevel`, `internal` or `rack`: `herringbone` is two helical halves turning opposite ways (centres itself on its shaft, no axial thrust; same `helixAngle` and `helixQuality` as `helical`); `internal` is a ring gear with its teeth pointing in, the outer wheel of a planetary set - its width and depth are its outside, module x (teeth + 2.5) + 2 x `gearRim` (the rim round the teeth, default 3), and a pinion of the same module runs inside it at module x (teeth - pinion teeth) / 2; `rack` is a bar along x with its teeth towards +z, width teeth x pi x module so racks line up end to end, depth the bar's thickness (free above the teeth plus 0.5), and a gear rolls on it with its centre its teeth x module / 2 in front of the pitch line, a module behind the tips. Ring gear and rack take involute or round teeth, never simple ones, and have no centre hole. A `hirth` is a Hirth joint: a disc with V-shaped teeth running out from the centre (`teeth`, 6 to 90, default 24), `toothSize` their height at the rim (default right-angled teeth, up to the whole `height`, the roots then touching the bottom at the rim), `centerHoleSize` the bore (default 10, 0 for none), `height` the whole height with the crests on top; `hirthSteepFlank` (45 to 90, 90 a straight step) gives saw teeth like a ratchet, one flank that steep and the other gentle, and `hirthReverse: true` puts the steep flank on the other side (`hirthSteepFlank: 0` makes the teeth symmetric again); a copy turned 180 degrees about x (`rotationX: 180`) and standing `height - toothSize` higher locks into it at every tooth, saw teeth too. A `pulley` is a GT2 timing belt pulley for a 2 mm GT2 belt: `teeth` (10 to 200, default 20) set its size - the outside diameter is teeth x 2 / pi - 0.508 mm, 12.22 for 20 teeth - with the GT2 groove made of arcs; from the bottom up a flange, the toothed band `pulleyBeltWidth` wide (default 7 for a 6 mm belt, about 11 for 10 mm), a flange, and the hub; `pulleyFlange` is each flange's thickness (default 1, 0 for none), `pulleyFlangeRise` how far the flanges reach past the teeth (default 1.5), `pulleyHubHeight` and `pulleyHubDiameter` the hub on top (default 6 and 12, height 0 for none), `centerHoleSize` the bore (default 5); width, depth and height follow from these and are not set directly, and for a set screw a hole cylinder goes through the hub. It is an exact body. A `knurl` with `knurlPattern: "round"` has its straight grooves and ridges as a smooth wave of arcs - a grip for a knob whose number of grooves (`knurlCount`), depth and end chamfer are free, unlike a gear's. `gearProfile: "round"` gives round teeth made of arcs instead, like Tinkercad's Useful gear - forgiving on small printed gears and a smooth grip on a knob; they stand lower, so a round gear's outside diameter is module x (`teeth` + 1.2), and round gears mesh with round ones of the same module (no pressure angle, backlash as above). Two gears mesh with the same module and pressure angle at a centre distance of module x (teeth1 + teeth2) / 2 between their centres; for helical gears `helixAngle` is then the true helix angle, and a meshing pair takes the same angle with opposite signs. A `bevel` gear takes `bevelHelixAngle` (default 0) to turn its teeth while they taper, a spiral bevel gear, which stays a triangle mesh. A ring gear (`internal`) and a `rack` take `ringRackHelixAngle` (-45 to 45, default 0 for straight teeth, #1627) to run with a helical gear: give them the same angle as that gear, not the opposite one; `ringRackHerringbone: true` turns their teeth back at half the height, for a herringbone gear of the same angle. The rack keeps its length, its teeth cut off square at both ends; both are exact bodies, a ring gear only on a round footprint, with `helixQuality` for how finely its turn is drawn. A `slot` (the capsule) can have one end smaller than the other, a belt guard round two pulleys: `slotEndRatio` is the small end's diameter as a share of the large one (0.1 to 1, default 1 for two equal ends). The large end sits at the start of the long side (-x, or -z when standing), its diameter is the short side, the small end touches the far end, and the sides run as tangents to both, so the centre distance is the long side less both radii. It stays an exact body. Every shape except gear, hirth, pulley, thread, spring, gridfinity, hinge, pyramid, bentTube, loft, teardrop, counterbore, countersink, finishingWasher and ruler can be tapered through `taperTopWidth`, `taperTopDepth`, `taperBottomWidth` and `taperBottomDepth`, and twisted or leaned through `extrudeTwist`, `extrudeTopOffsetX` and `extrudeTopOffsetZ`; naming one value of a face pins the other one as it stands.
+- `layerling_create_shape`: create any shape the editor has a tile for - `box`, `cube`, `cylinder`, `polygon`, `sphere`, `cone`, `pyramid`, `wedge`, `roundRoof`, `halfSphere`, `paraboloid`, `curvedCone` (a cone whose side bends: `curvedConeTop` the top as a share of the bottom, `curvedConeBend` -1 inward to a trumpet, 1 outward to a dome), `torus`, `tube`, `loft`, `text`, `thread`, `spring`, `gridfinity`, `gear`, `hirth`, `pulley`, `finishingWasher`, the enclosure parts `boxGenerator` (a box or its lid from settings: `boxShape` rectangle, round or polygon, `boxWall`, `boxFloor`, `boxColumns` and `boxRows` for fixed compartments, `boxPart` box, lid or latch (the clip), `boxLidStyle` restOn, overlap or plug, `boxFit`, `boxLatches` clips per side with `boxLatchSides`, `boxLatchWidth` and `boxLatchGrip`; make one shape per part with the same settings), `screwBoss` (a post with a hole: `screwBossFastener` insert, selfTapping or custom, `screwBossSize` M3, #4-40, ST2.9 ..., optional `screwBossGussets`), `snapFit` (a cantilever hook and its catch: `snapFitPart` both, hook or catch, `snapFitUndercut`, `snapFitRetainAngle` 90 holds for good, 45 comes apart) and `rib` (`ribStyle` straight or gusset; `ribFoot: true` stands it on a thin, wider foot for more hold on the bed, `depth` then the foot's width, `ribThickness` the rib's and `ribFootThickness` the foot's; `ribFootShape: "oval"` makes the foot an ellipse without corners, just long enough that the rib's ends still stand on it, `width` then the ellipse's length and the rib inside it shorter) - or a `sketch` extrusion; a `sketch` with `stroke: { width, align, join, cap }` is built as a frame of that width round its outline (align `center`, `inside` or `outside`), as the editor's Stroke does, or with align `grow` as the area widened by that width. Size and everything beyond it are optional and fall back to what the editor uses when the same shape is placed by hand. A `thread` is a rod, a screw, a nut or a tapped hole, set through `threadRole`; its width and depth follow `threadDiameter` and are not given separately. `threadHead` is a screw's head (`cylinder`, `countersunk`, `hex`, `square`, `flange`, `wing`, `knob`) and a nut's shape (`hex`, `square`, `flange`, `wing`, `knob`); a wing or knob prints lying flat and is turned by hand. `threadCollarHeight` puts a round collar between a screw's head and its thread (not under a countersunk head), a spacer under a star knob or a shoulder under a head, or on a nut's top face; `threadCollarDiameter` sets its width (twice the thread by default, always inside the head or nut), and the thread keeps its length (a nut its body). For a standard size pass `threadSize` with its name from the editor's size menu - `M6`, `1/4"-20 UNC`, `G1/2`, `1/2" NPT` - instead of `threadDiameter` and `threadPitch`; a lead screw with several threads side by side takes `threadStarts` (T8x8: `threadDiameter` 8, `threadPitch` 2, `threadStarts` 4, `threadProfile` `trapezoidal`; a size sets it back to 1); an NPT size is tapered (`threadTaper` true: 1 in 16 on the diameter, which is the wide end's; a rod or screw narrows towards its tip at the top, a nut or tapped hole widens towards its mouth at the top), every other size straight, and `threadTaper` tapers any thread; a `settings` block read back with all three still works, a diameter or pitch that does not match the size is refused. `threadClearance` gives nuts and tapped holes room (default 0.2 mm); `threadBoltClearance` makes a rod or screw that much thinner in diameter (default 0), for a printed bolt that has to go into a metal nut. `threadProfile` `custom` is a symmetric trapezoid you shape yourself: `threadFlankAngle` (10 to 90 degrees between the two flanks, default 60) and `threadDepth` (mm, outer minus core radius; the core diameter is `threadDiameter` minus twice that), for example 90 degrees and a depth of 0.4 x the pitch for a thread that prints without supports. `threadAxialClearance` (default 0, at most a fifth of the pitch) gives nuts and tapped holes play along the axis: each tooth of the part gets that much thinner while the diameter stays, so a printed thread can turn freely without rattling sideways - try `threadClearance` 0.2 with `threadAxialClearance` 0.2. A `spring` winds right-hand like a usual compression spring; `springHand: "left"` winds it the other way. `springForm: "flat"` makes it a flat spring instead (#1076): a band running in waves across the plate, printed lying down - `width` is its length, `depth` how far the waves reach, `height` its thickness (a new one is 60 x 16 x 4 unless sizes are given; switching an existing spring keeps its size, so pass the new sizes with it). `springPattern` is `round` (default), `zigzag` or `square`, `springEnds` `eye` (default, a ring with a hole at each end), `tab` or `none`; `springTurns` counts its bends and `springWire` is the band width. It is an exact body. A G size is a parallel Whitworth pipe thread (BSPP, ISO 228-1, as on fittings for water, gas, hydraulics and pneumatics; G1 is 33.249 mm across with 11 threads per inch) and turns a `v` profile into `whitworth`, the 55 degree profile with rounded crest and root; an M, UNC or UNF size turns `whitworth` back into `v`. `PCO 1881` is the 28 mm neck of most water and soda bottles (27.4 mm across, pitch 2.7, #1079): it sets `threadProfile` `custom` with `threadDepth` 1.6 and `threadFlankAngle` 30 unless the call gives them; make the neck a `rod` and the cap a `nut`, or a `bore` taken out of a cylinder. `S60x6 (IBC)` is the outlet thread of IBC containers (DIN 6063-1, KS 60: 60 mm across, pitch 6, core 54; #1094) and sets `custom` with `threadDepth` 3 and `threadFlankAngle` 30 the same way; its real flanks are unequal, the profile has two equal ones. A cylinder without `sides` picks its own side count from the diameter, the way the editor does. A `teardrop` is the cross-section of a horizontal hole that prints without supports: `width` is the diameter of its round part, `depth` its length along the hole and `height` the full height up to the tip (about 1.207 x width gives the usual 90 degree tip; the editor's tip angle is derived from it). A `port` is the opening for a USB, HDMI, DisplayPort or RJ45 socket in a box wall, lying on its side like the teardrop and a hole from the start: `portPreset` (`usbC`, `usbCPlug`, `microUsb`, `usbA`, `hdmi`, `miniHdmi`, `microHdmi`, `displayPort`, `miniDisplayPort`, `rj45`) gives the socket's size from data sheets with a little room, and `portClearance` (0 to 2 mm, #1098) adds that much more on every side, the corners rounder by it; otherwise `width` and `height` are the opening seen from the front, `cornerFillet` its corner radius, `portProfile` cuts the lower corners as on HDMI or DisplayPort and `depth` is how far it reaches through the wall. A `tube` with `washer` (`M1.6` to `M30`) is that screw size's washer to ISO 7089 (M5: 10 mm across, 5.3 mm bore, 1 mm thick). A `counterbore`, `countersink` or `doubleCountersink` with `screwSize` (`M2` to `M30`, a countersink up to `M20` and the inch sizes `#2` to `#14`) takes that screw's hole: shaft as the ISO 273 medium clearance hole (M5 5.5 mm), a counterbore's head to DIN 974-1 (M5 10 mm, as deep as the diameter plus 0.4), a countersink's to ISO 15065 at 90 degrees (M5 10.4 mm); an inch size is ASME B18.6.1 at 82 degrees, which are also the Australian gauges (#6: head 7.09 mm, shaft 3.9 mm). A screw hole's `height` is its whole length. Socket head cap screws are sold by the length under the head, so a counterbore for one takes `height` = that length plus `screwHoleHeadDepth` (M3 x 12 with the 3.2 mm pocket: 15.2), as the counterbore's field Screw length does (#1670); countersunk screws are measured with the head, so a countersink's `height` is the screw's length. A `finishingWasher` is the domed washer (rosette) under a countersunk screw (#1131): flat underneath, a dome rising from a low rim to the seat, a cone of `screwHoleAngle` (90 default) `screwHoleHeadDepth` deep for the head, and the bore `screwHoleShaft`; `width` is its outer diameter (it stays round), `height` the whole height. With `screwSize` (`M2` to `M20`) it takes that screw's measures (M3 10.3 x 2.95 mm, M6 16.6 x 4.5 mm). It is an exact body. A `polygon` with `nut` (`M2` to `M30`) is the pocket for that ISO 4032 hex nut, 0.4 mm wider across flats (`width`) and higher than the nut; make it a `hole`. A `counterbore` (round head pocket, `screwHoleHeadDepth`) or `countersink` (cone, `screwHoleAngle`, 90 for a countersunk screw) is a cutter for a screw head: `width` is the head diameter, `screwHoleShaft` the shaft diameter, `height` the whole length, head end on top; set `hole` and let its top end a little above the surface. A blind hole can end in a drill point (Discussion #621): `drillPointAngle` (60 to 150, 118 for a common twist drill) on a `cylinder` set as `hole`, a `counterbore` or a `countersink` puts the cone of the drill's tip below its bottom, as wide as the hole or the shaft; the `height` stays the depth to the shoulder, as in a drawing, and the tip reaches (diameter / 2) / tan(angle / 2) further down, so a hole 10 deep and 5 wide at 118 ends 11.5 below its top. `drillPointAngle` 0 makes the bottom flat again. `screwHoleSlot` true on a `counterbore`, `countersink` or `doubleCountersink` makes it a slotted hole for lining a part up (#1531): the shorter of `width` and `depth` is the head diameter, the difference the slot's length along the longer one (width 14, depth 6.6: an M3 countersink with a 7.4 mm slot along x); `screwHoleRecess` on a `countersink` or `doubleCountersink` sinks the head that many mm below the face with a straight pocket as wide as the head above the cone (#1531); it has no drill point. `screwHoleChamfer` on a `counterbore` puts a 45-degree chamfer that many mm deep on the rim of the pocket (#1632), opening outside the head diameter so the head still fits; it stays shallower than the pocket. A `doubleCountersink` is a hole chamfered on both faces (#392): `width` is the head diameter at both ends, `screwHoleShaft` the shaft between the two cones, `screwHoleAngle` the cone angle (90 default), `height` the whole length; if two full cones do not fit, they meet in the middle at that angle and the shaft stays wider than set. Push it through a part as a `hole`. A `hinge` is a print-in-place hinge lying open flat: `width` is its length along the axis, `depth` both leaves together, `height` the knuckle diameter; `hingeKnuckles` (odd, default 5), `hingePinDiameter`, `hingeLeafThickness` and `hingeClearance` (default 0.4 mm, raise it if a printer fuses the parts) set the rest, and it prints in one piece; `hingePinless: true` leaves the printed pin out and runs the bore through every knuckle, for a pin of your own; `hingeAngle` (-180 to 180, default 0) folds the second leaf up about the pin, 0 lying flat, 180 closed, below 0 folded down past lying flat. `hingeStyle: "liftOff"` makes a lift-off hinge: two knuckles, the pin on the lower one, the upper one a sleeve that comes off it. `hingeStyle: "snap"` makes a snap-on hinge (Discussion #1520): one leaf's knuckles carry the pin, the other's are clips open on top (the side facing the other leaf when closed), narrower than the pin by `hingeSnapGrip` (default 0.3 mm) with a 45 degree lead-in; separate the parts, print both halves flat without supports, then press the clip half onto the pin, closed, until it clicks. `hingeScrewHoles` (0 to 6 per leaf) adds screw holes with `hingeScrewDiameter`, `hingeScrewSpacing` (along the axis) and `hingeScrewAcross` (centre to centre across both leaves), countersunk unless `hingeScrewHead` says `straight`, `nut` (hexagonal nut pockets, their size by `hingeNutWidth`) or `countersunkNut`; `hingeCornerRadius` rounds the leaves' outer corners; `hingeLeafStyle: "fingers"` gives each knuckle its own finger instead, the two sides alternating like combs, to fold all the way round and to join to a box and its lid; `hingeLeafStyle: "raised"` lifts the second leaf so that, closed, it lies flat on the first with the clearance between, and the hinge folds well past lying flat (it prints with supports under that leaf). A `gridfinity` is a bin or a baseplate for the Gridfinity storage system, to the published measures so it fits parts printed from other designs: `gridfinityType` `bin` (default) or `baseplate`, or `tray` (#837), a tray of any size with a flat bottom and no feet, lip or magnet holes: its `width` and `depth` are free in mm (10 to 252) and its `height` too (3 to 140), kept as given (a new one is 80 x 40 x 20), and the bin's settings below apply to it except the lip, the lip chamfer, the magnets and the half-size grid; its floor starts at 1.2 mm, it takes as many compartments as leave each at least 6 mm wide (up to 24 along a side and 40 in all), and its dividers and label shelves run up to its top. A bin's or baseplate's size is whole grid units of 42 mm, and any `width`, `depth` or `height` is rounded to them: a bin is 42 x units - 0.5 across and deep (41.5, 83.5 ... up to 6 units) and 7 mm per height unit (up to 20) plus 4.4 for the stacking lip (a 3-unit bin is 25.4 tall); a baseplate is 42 x units across and deep, up to 6 units, or 12 with `gridfinityLargePlate` (default false, for print beds over 256 mm), plus its padding, and 5 tall. `gridfinitySwallowtail` (default false) puts a baseplate on a 2.4 mm floor, 7.4 mm tall, with half a bow-tie pocket under each side without padding, so two plates side by side make whole pockets across the seam; `gridfinityKeys: true` on create or update lays out its keys in front of it, one for each pocket at its back and right, returned as parts (not for an outline plate); `gridfinitySwallowtailClearance` (mm, 0 to 0.15, default 0.05) is how much smaller than its pocket each key is on every side, raised if printed keys jam or break. A baseplate given `gridfinityOutline` (points `{ x, z }` in mm in its own frame) fills that outline instead: whole 42 mm cells inside it get sockets, at most 6 across and 6 deep (12 with `gridfinityLargePlate`), the rest is solid, and its box is the outline's bounds, at most 334 mm a side (586 mm with `gridfinityLargePlate`) and at least 10 mm; an empty list takes the outline away. On a bin, `gridfinityLip` (default true) is the stacking lip and `gridfinityMagnets` (default false) adds holes for 6 x 2 mm magnets under each foot; a baseplate has none. `gridfinityHalfGrid` (default false) puts a bin on a half-size grid: width and depth count cells of 21 mm (21 x units - 0.5, up to 12 units), each with its own foot, four to an ordinary baseplate's socket; with magnets each foot gets one hole. A bin of 3 height units or more takes label shelves along its inner walls (their top 0.85 mm below 7 mm per height unit, clear of the feet of a bin stacked on the lip): `gridfinityLabelBack`, `gridfinityLabelFront`, `gridfinityLabelLeft` and `gridfinityLabelRight` (default false, any together; where two meet they join), each with its own width, length and offset, as in `gridfinityLabelBackWidth` (mm out from the wall, default 14, at most about 17 in a bin of 3 units), `gridfinityLabelBackLength` (0, the default, runs it from wall to wall) and `gridfinityLabelBackOffset` (moves a set length along its wall from the middle; positive is +x on the back and front walls and +z on the sides), and likewise for Front, Left and Right; and `gridfinityLabelCorner` `round` (default) or `chamfer` with `gridfinityLabelCornerSize` (default 2, 0 for sharp corners) for the corners where a shelf meets a wall or another shelf. Any bin of 2 height units or more takes finger scoops, the floor rising along a quarter circle into the wall: `gridfinityScoopBack`, `gridfinityScoopFront`, `gridfinityScoopLeft` and `gridfinityScoopRight` (default false, any together), with one `gridfinityScoopRadius` (mm, at least 3.5; unset, it is half the height from the floor up to the lip's support, or to the top without the lip: 6.7 in a bin of 3 units with the lip and the 0.95 mm wall); every floor edge of the bin is then rounded as much as its inner corners (2.8 mm with the 0.95 mm wall). `gridfinityFloorHeight` (mm from the underside, default 5.95) raises the floor of a bin, solid up to it, for a blank to cut shapes into: with the lip a bin still stacks on it up to the lip's support (19.35 in a bin of 3 units with the 0.95 mm wall), and from the lip's top up (25.4 for 3 units) it fills the lip too, a solid block with a flat top; between the two it is built at the highest floor a bin still stacks on; without the lip, at most the top; scoops start on it and shelves can reach less far out above it; both are left out when it leaves them no room. `gridfinityOpenBack`, `gridfinityOpenFront`, `gridfinityOpenLeft` and `gridfinityOpenRight` (default false, any together) take away that side's wall and lip above the floor; the walls beside it run out to the outline and end square, so open bins side by side make one continuous run, the floor runs flat to the edge, and a shelf or scoop on an open side is not built, nor a compartment label. `gridfinityOpenings` opens a side switched open only partly: one entry per side with `side`, `depth` (mm down from the lip's top, at least 2), `width` (mm along the side, at least 5), `align` (`start`, `middle` by default, or `end`) and `distance` (mm from that end); without an entry, at the whole width down to the floor (each within 0.5 mm), or where the side's straight part is shorter than 5 mm, the side is open in full, and anything less cuts a notch out of its wall and lip, which keep their rounded corners; shelves, compartment labels and scoops stay off that side, and a bin built solid by its wall takes no notch. `gridfinityOpeningCorner` (`round` by default or `chamfer`) and `gridfinityOpeningCornerSize` (mm, 0 to 10, default 0 for square) round or chamfer every notch's two top and two bottom corners seen from outside the wall; each corner takes at most what the notch and the wall beside it leave, the top ones first, and up to 0.5 mm less where it would end just beside an edge of the wall, to keep clear of it; under 0.5 mm it stays square, a notch across the whole side has no top corners, and an end run out to the outline beside a side open in full has none. `gridfinityLipChamfer` (a bin with the lip, mm, 0 to 1, default 0 for the sharp top the specification draws) chamfers the lip's top edge as the edge tool's chamfer of that size would, down the outer wall and down the slope a stacked bin rests on; the height setting and how high bins stack stay as they are, and the top comes down by 0.71 x the chamfer. `gridfinityWallThickness` (a bin, mm, default 0.95, from 0.8 up to where the walls meet) sets the wall in from an outside that never changes, so the bin still fits and stacks; over 1.75 mm with the lip the wall stops at a ledge 0.85 mm under 7 mm per height unit, clear of a stacked bin's feet, a wall that leaves less than 1 mm inside builds the bin solid, and scoops, shelves and compartments that no longer have room are left out or fewer. `gridfinityPaddingBack`, `gridfinityPaddingFront`, `gridfinityPaddingLeft` and `gridfinityPaddingRight` (baseplate only, mm, default 0, at most 41) add a solid border at the plate's height outside the grid, so the plate fills a drawer that is not whole units; width and depth are the whole plate with its padding, and a padding given without width and depth keeps the units. `gridfinityCornerRadius` (baseplate only, mm, 0 to 4, default 4) sets the radius of the plate's four outer corners, 4 as the specification draws them, down to 0 for a drawer's square corners; the sockets keep theirs, so bins fit as before. `gridfinityBinCornerRadius` (bin only, mm, 0 to 3.75, default 3.75) sets the radius of a bin's outer corners above its feet, down to 0 so bins side by side in a drawer leave only their 0.5 mm gaps where four meet; the feet, the inside and the lip's slopes keep their rounding, and the wall's first 0.5 mm over the feet keeps 3.75, so the bin fits and stacks as before. `gridfinityCompartmentsX` and `gridfinityCompartmentsZ` (default 1) divide a bin of 2 height units or more into compartments with dividers of the full height (their top 0.85 mm below 7 mm per height unit, like the shelves), up to 4 per grid unit each way and 40 in all, each compartment at least 6 mm wide; `gridfinityDividerThickness` is mm, 0.8 to 3 (default 1.2), and `gridfinityDividerPositionsX`/`gridfinityDividerPositionsZ` place the dividers in mm from the inside of the left or back wall to each divider's middle (unset or `[]`, evenly spaced; once set, that axis keeps them in mm when the bin is resized; giving a count puts that axis's dividers back evenly spaced unless its positions are given in the same call). Scoops repeat in every compartment against the wall or divider on their side, made smaller in a narrow compartment and left out where even 3.5 mm does not fit. A divided bin of 3 height units or more takes `gridfinityCompartmentLabels` instead of the wall shelves: a list of `{ column, row, side, length, align, width, text }`, one per compartment (column 0 the left, row 0 the back; side `back`, `front`, `left` or `right`, the wall or divider it stands against; length 10 to 100 per cent of that side; align `start`, `middle` or `end`; width mm, default 14; text, see below), with the shelves' corner settings. A shelf can carry a text raised 0.4 mm on its top as part of the bin: `gridfinityLabelBackText`, `gridfinityLabelFrontText`, `gridfinityLabelLeftText`, `gridfinityLabelRightText` or a compartment label's `text`, one line of up to 24 characters in `gridfinityLabelFont` (a built-in font, default Multilanguage, or a font of one's own by its name or id), fitted as large as the shelf's top lets it, or with capitals `gridfinityLabelTextSize` mm high on every shelf where it lets them (0, the default, for as large as each lets them); a text whose capitals would be under 3 mm is left out, and a tray has none. `gridfinityLabelColor` (#rrggbb, an empty string for the bin's own colour) gives the letters a colour of their own: the bin stays one body, a 3MF carries the letters' faces in that colour, painted for OrcaSlicer and PrusaSlicer 2.9 too, and an OBJ their points. A bin is an exact body, so the edge tool and STEP work on it. A `loft` ("Übergang" in German) joins an outline at the bottom to another at the top with a straight-ruled wall - a hose adapter, a square fan onto a round duct, a stand: `loftBottomOutline` and `loftTopOutline` are `round` (circle or ellipse), `rectangle` (corners rounded by `loftBottomCorner`/`loftTopCorner`) or `polygon` (`loftBottomSides`/`loftTopSides`), `loftBottomWidth`/`loftBottomDepth` and `loftTopWidth`/`loftTopDepth` size the ends, `loftOffsetX`/`loftOffsetZ` move the top sideways (the bottom stays put), and `loftWall` above 0 makes it a tube open at both ends; `loftTopWall` gives the top end a wall of its own (3 mm at the bottom and 1 mm at the top, say; left out it follows `loftWall`, and sections in between take the wall evenly by their height). `loftSections` (#1034, up to 12) puts sections between the ends, each `{ at, outline, width, depth }` with `at` a share of the height (0.01 to 0.99) and `corner`, `sides`, `offsetX`, `offsetZ` as needed, and the body goes through all of them: `loftThrough` `smooth` (default, one curved surface) or `straight` (flat walls from section to section); twist, tilt and `loftSmooth` are left aside while there are sections, and `[]` removes them. `loftSmooth` (0 to 1, default 0) lets the sides follow an S-curve between the ends instead of a straight line, for a hose adapter that flares smoothly; `loftSegments` (16 to 360, default 96) sets how many straight pieces a full circle or rounded corner is drawn with in the view and the exports; `loftTwist` turns the section evenly from bottom to top about the vertical (degrees, up to 360 either way), and `loftTiltX`/`loftTiltZ` tilt the top end (degrees, up to 45: positive raises its front +z edge / its right +x side); the sections tilt evenly on the way up and the highest point stays at the height. Its width and depth are what both ends need together and are not given separately; `settings` reports the ends as the body shows them. It is an exact body, so the edge tool and STEP work on it. A `gear` gets involute teeth that mesh (`gearProfile: "involute"`, the default for a new gear; `"simple"` is the plain straight teeth older designs have, set by `toothSize` and `toothWidth`). An involute gear is set like a gear generator: its `width` and `depth` are its outside diameter, module x (`teeth` + 2), so module 1.5 with 20 teeth is 33 - give both, and change them with `teeth` to keep the module. `gearPressureAngle` (default 20) and `gearBacklash` (play of the pair in mm, default 0.2, half taken off each gear) set the rest. `gearType` is `spur`, `helical`, `herringbone`, `bevel`, `internal` or `rack`: `herringbone` is two helical halves turning opposite ways (centres itself on its shaft, no axial thrust; same `helixAngle` and `helixQuality` as `helical`); `internal` is a ring gear with its teeth pointing in, the outer wheel of a planetary set - its width and depth are its outside, module x (teeth + 2.5) + 2 x `gearRim` (the rim round the teeth, default 3), and a pinion of the same module runs inside it at module x (teeth - pinion teeth) / 2; `rack` is a bar along x with its teeth towards +z, width teeth x pi x module so racks line up end to end, depth the bar's thickness (free above the teeth plus 0.5), and a gear rolls on it with its centre its teeth x module / 2 in front of the pitch line, a module behind the tips. Ring gear and rack take involute or round teeth, never simple ones, and have no centre hole. A `hirth` is a Hirth joint: a disc with V-shaped teeth running out from the centre (`teeth`, 6 to 90, default 24), `toothSize` their height at the rim (default right-angled teeth, up to the whole `height`, the roots then touching the bottom at the rim), `centerHoleSize` the bore (default 10, 0 for none), `height` the whole height with the crests on top; `hirthSteepFlank` (45 to 90, 90 a straight step) gives saw teeth like a ratchet, one flank that steep and the other gentle, and `hirthReverse: true` puts the steep flank on the other side (`hirthSteepFlank: 0` makes the teeth symmetric again); a copy turned 180 degrees about x (`rotationX: 180`) and standing `height - toothSize` higher locks into it at every tooth, saw teeth too. A `pulley` is a GT2 timing belt pulley for a 2 mm GT2 belt: `teeth` (10 to 200, default 20) set its size - the outside diameter is teeth x 2 / pi - 0.508 mm, 12.22 for 20 teeth - with the GT2 groove made of arcs; from the bottom up a flange, the toothed band `pulleyBeltWidth` wide (default 7 for a 6 mm belt, about 11 for 10 mm), a flange, and the hub; `pulleyFlange` is each flange's thickness (default 1, 0 for none), `pulleyFlangeRise` how far the flanges reach past the teeth (default 1.5), `pulleyHubHeight` and `pulleyHubDiameter` the hub on top (default 6 and 12, height 0 for none), `centerHoleSize` the bore (default 5); width, depth and height follow from these and are not set directly, and for a set screw a hole cylinder goes through the hub. It is an exact body. A `knurl` with `knurlPattern: "round"` has its straight grooves and ridges as a smooth wave of arcs - a grip for a knob whose number of grooves (`knurlCount`), depth and end chamfer are free, unlike a gear's. `gearProfile: "round"` gives round teeth made of arcs instead, like Tinkercad's Useful gear - forgiving on small printed gears and a smooth grip on a knob; they stand lower, so a round gear's outside diameter is module x (`teeth` + 1.2), and round gears mesh with round ones of the same module (no pressure angle, backlash as above). Two gears mesh with the same module and pressure angle at a centre distance of module x (teeth1 + teeth2) / 2 between their centres; for helical gears `helixAngle` is then the true helix angle, and a meshing pair takes the same angle with opposite signs. A `bevel` gear takes `bevelHelixAngle` (default 0) to turn its teeth while they taper, a spiral bevel gear, which stays a triangle mesh. A ring gear (`internal`) and a `rack` take `ringRackHelixAngle` (-45 to 45, default 0 for straight teeth, #1627) to run with a helical gear: give them the same angle as that gear, not the opposite one; `ringRackHerringbone: true` turns their teeth back at half the height, for a herringbone gear of the same angle. The rack keeps its length, its teeth cut off square at both ends; both are exact bodies, a ring gear only on a round footprint, with `helixQuality` for how finely its turn is drawn. A `slot` (the capsule) can have one end smaller than the other, a belt guard round two pulleys: `slotEndRatio` is the small end's diameter as a share of the large one (0.1 to 1, default 1 for two equal ends). The large end sits at the start of the long side (-x, or -z when standing), its diameter is the short side, the small end touches the far end, and the sides run as tangents to both, so the centre distance is the long side less both radii. It stays an exact body. Every shape except gear, hirth, pulley, thread, spring, gridfinity, hinge, pyramid, bentTube, loft, teardrop, counterbore, countersink, finishingWasher and ruler can be tapered through `taperTopWidth`, `taperTopDepth`, `taperBottomWidth` and `taperBottomDepth`, and twisted or leaned through `extrudeTwist`, `extrudeTopOffsetX` and `extrudeTopOffsetZ`; naming one value of a face pins the other one as it stands.
- `layerling_import_file`: import a file as the import window does (STL, OBJ, 3MF, STEP, SVG, DXF or a ZIP of them), content as `text` or `base64`; a DXF (#774) comes in as parts in millimetres, 4 mm high: every closed outline a sketch body, every hole in it a loose hole beside it (a round one a cylinder hole, others sketch holes) to move and size like any hole (arcs kept as true arcs, text, dimensions, hatches and open outlines left out); an SVG with `keepPagePosition: true` keeps its place on its page (viewBox), so files of one page line up; `svgWidth` (mm) scales an SVG or a picture to that width on the way in; a coloured OBJ (vertex colours, or materials with `mtl`) or 3MF (its own colours, or the filaments of a Bambu Studio, OrcaSlicer or PrusaSlicer project) comes in as one body per colour; a 3MF with several objects comes in as one body per object (and per colour within it). Slicer modifiers, negative volumes and support blockers are left out. An SVG comes in as an extruded sketch body (4 mm high, reading from above as in the drawing) whose fill `layerling_update_object` changes with `stroke` and `silhouette`; only one with more than 2500 lines and curves comes in as a fixed mesh. layerling is made first of all for exact CAD bodies: an import that brings in a mesh of 400,000 triangles or more, or takes the design's STL, OBJ and 3MF meshes to a million together, returns `warning` (#1652), since meshes this large make the editor slow and saving slow; simplify them with `layerling_simplify_mesh` or build simple parts from the editor's shapes.
- `layerling_import_mesh`: import STL-style mesh data into the editor.
- `layerling_add_font`: add a font of one's own for texts and the letters of Gridfinity bins from a TrueType, OpenType or WOFF file as `base64` (with its `fileName`); WOFF2 and .ttc collections are refused. It returns the font's `id` (`custom:...`) and `name`; use either as `font` on a text or as `gridfinityLabelFont` on a Gridfinity bin; `useOnSelection` puts it on the selected ones. The font stays in the browser the editor runs in; a saved design keeps only the outlines of the letters its texts and bins use, so it opens anywhere, and new letters need the font there too. Check a font's licence before passing a design on. Installed system fonts can only be picked by hand in the editor (Chrome and Edge).
diff --git a/apps/web/src/components/LayerlingEditor.tsx b/apps/web/src/components/LayerlingEditor.tsx
index d22f1d3818..27b22aede5 100644
--- a/apps/web/src/components/LayerlingEditor.tsx
+++ b/apps/web/src/components/LayerlingEditor.tsx
@@ -20,7 +20,7 @@ import { hingePartScope, hingeWorldParts } from "@/lib/hingeParts";
import { copyViaSelectionField, decodeClipboardPayload, encodeClipboardPayload, LOCAL_CLIPBOARD_LIMIT, newestClipboard, type ClipboardPayload } from "@/lib/clipboardPayload";
import { bentTubeNaturalDimensions, normalizedBentTubeFields } from "@/lib/bentTubeGeometry";
import { GRIDFINITY_SWALLOWTAIL_KEY_THICKNESS, gridfinityHasLabelText, gridfinityOutlineFit, gridfinityOutlineFromLoops, gridfinityOutlineToPlate, gridfinityPlan, gridfinityPlateFlat, gridfinityPlateToWorld, gridfinitySceneWithKeys, gridfinitySwallowtailKeyCount, gridfinitySwallowtailKeyProfile, gridfinitySwallowtailKeys } from "@/lib/gridfinityGeometry";
-import { boxGeneratorFieldsOf, boxGeneratorInsideOutline, boxGeneratorMatchingLidPatch, normalizeBoxGenerator } from "@/lib/boxGeneratorGeometry";
+import { boxGeneratorFieldsOf, boxGeneratorInsideOutline, boxGeneratorLatchClip, boxGeneratorMatchingLidPatch, boxGeneratorPlan, normalizeBoxGenerator } from "@/lib/boxGeneratorGeometry";
import { DEFAULT_THREAD_PROFILE, defaultThreadHeadHeight, normalizeThreadHeadHeight, threadCollarFields, threadCollarSettings, threadDriveFields, threadDriveSettings, threadNaturalFootprint, threadSettings } from "@/lib/threadGeometry";
import { textOffsetAsFill } from "@/lib/textFillChoice";
import { curvedTextPatch, MAX_TEXT_LETTER_WIDTH, MAX_TEXT_SPACING, MIN_TEXT_LETTER_WIDTH, MIN_TEXT_SPACING } from "@/lib/textGeometry";
@@ -12549,6 +12549,41 @@ export function LayerlingEditor({
commitShapes([...shapesRef.current, lid], [lid.id], t("status.boxLidMade", { name }));
}, [commitShapes]);
+ /**
+ * The clips for a box generator part's latches, laid out in a row in front of it: one copy with the part set to the clip
+ * for each latch the part has, everything else the part's own, so they fit its pins and the lid's.
+ */
+ const makeBoxLatches = useCallback((boxId: string) => {
+ const box = shapesRef.current.find((shape) => shape.id === boxId);
+ if (!box || box.kind !== "boxGenerator") return;
+ if (box.locked) {
+ setNotice(t("status.objectLocked"), true);
+ return;
+ }
+ if (historyViewStateRef.current) {
+ setNotice(t("status.historyViewBlocksEdits"), true);
+ return;
+ }
+ const size = { width: shapeWidth(box), depth: shapeDepth(box), height: box.height };
+ const fields = boxGeneratorFieldsOf(box);
+ const count = boxGeneratorPlan(size, fields).latches?.spots.length ?? 0;
+ if (count === 0) {
+ setNotice(t("status.boxLatchesNone"), true);
+ return;
+ }
+ const clip = boxGeneratorLatchClip(fields).size;
+ // In a row in front of the part as it stands, 4 mm apart, upright on its level as they print.
+ const bounds = boundsForShapes([box]);
+ const clips = Array.from({ length: count }, (_, index) => {
+ const name = `${displayShapeName(box)} \u2013 ${t("boxGenerator.partLatch")} ${index + 1}`;
+ const copy = cloneWorkplaneShapeTreeWithFreshIds(box, "copy");
+ const x = bounds.minX + clip.width / 2 + index * (clip.width + 4);
+ const z = bounds.maxZ + 4 + clip.depth / 2;
+ return canonicalizeShape({ ...copy, boxPart: "latch", ...clip, size: resizedShapeSize(clip.width, clip.depth), name, x, z, elevation: bounds.minY, rotation: 0, rotationX: 0, rotationZ: 0 });
+ });
+ commitShapes([...shapesRef.current, ...clips], clips.map((part) => part.id), t("status.boxLatchesMade", { count: String(count) }));
+ }, [commitShapes]);
+
const makeSwallowtailKeys = useCallback(async (plateId: string) => {
const fail = (message: string) => {
setNotice(message, true);
@@ -19329,6 +19364,7 @@ export function LayerlingEditor({
onSurfaceRegionLasso={surfaceRegionLasso}
onVaseAccessories={selectedShapes.length === 1 && selectedShape?.kind === "vase" && !bodyLocked(selectedShape) ? () => layOutVaseAccessories(selectedShape.id) : undefined}
onMakeBoxLid={selectedShapes.length === 1 && selectedShape?.kind === "boxGenerator" && !historyViewState ? () => makeBoxLid(selectedShape.id) : undefined}
+ onMakeBoxLatches={selectedShapes.length === 1 && selectedShape?.kind === "boxGenerator" && !historyViewState ? () => makeBoxLatches(selectedShape.id) : undefined}
onGridfinityKeys={selectedShapes.length === 1 && selectedShape?.kind === "gridfinity" && selectedShape.gridfinitySwallowtail === true && !historyViewState ? () => void makeSwallowtailKeys(selectedShape.id) : undefined}
onLayerText={selectedShapes.length === 1 && offersTextLayers(selectedShape) ? layerSelectedText : undefined}
onTextTags={selectedShapes.length === 1 && offersTextLayers(selectedShape) ? makeTextTags : undefined}
diff --git a/apps/web/src/components/WorkplaneViewport.tsx b/apps/web/src/components/WorkplaneViewport.tsx
index a04f9cde60..638a9bdc12 100644
--- a/apps/web/src/components/WorkplaneViewport.tsx
+++ b/apps/web/src/components/WorkplaneViewport.tsx
@@ -262,6 +262,7 @@ type WorkplaneViewportProps = {
/** Lays the selected Swallowtail baseplate's keys out in front of it (#1061). */
onGridfinityKeys?: () => void;
onMakeBoxLid?: () => void;
+ onMakeBoxLatches?: () => void;
onLayerText?: (patch: TextLayerPatch) => void;
onTextTags?: (names: string[], gap: number) => void;
/** Several lines of text under one another, one text each (#1207). */
@@ -1657,6 +1658,7 @@ export function WorkplaneViewport({
onVaseAccessories,
onGridfinityKeys,
onMakeBoxLid,
+ onMakeBoxLatches,
onLayerText,
onTextTags,
onTextBlock,
@@ -9491,6 +9493,7 @@ export function WorkplaneViewport({
onVaseAccessories={onVaseAccessories}
onGridfinityKeys={onGridfinityKeys}
onMakeBoxLid={onMakeBoxLid}
+ onMakeBoxLatches={onMakeBoxLatches}
onLayerText={onLayerText}
onTextTags={onTextTags}
onTextBlock={onTextBlock}
diff --git a/apps/web/src/components/workplane/ShapeInspector.tsx b/apps/web/src/components/workplane/ShapeInspector.tsx
index 184e7435ce..44b5530bb6 100644
--- a/apps/web/src/components/workplane/ShapeInspector.tsx
+++ b/apps/web/src/components/workplane/ShapeInspector.tsx
@@ -207,8 +207,18 @@ import { DEFAULT_DRILL_POINT_ANGLE, DRILL_POINT_ANGLES, MAX_DRILL_POINT_ANGLE, M
import { MAX_TEARDROP_TIP_ANGLE, MIN_TEARDROP_TIP_ANGLE, normalizeTeardropTipAngle, teardropHeightForTipAngle, teardropTipAngle } from "@/lib/teardropGeometry";
import { MAX_PORT_CLEARANCE, maxPortCorner, normalizePortClearance, normalizePortCorner, PORT_PRESET_ORDER, PORT_PRESETS, portPresetFor, portPresetSize, type PortPreset } from "@/lib/portGeometry";
import {
+ DEFAULT_BOX_GENERATOR_DEPTH,
+ DEFAULT_BOX_GENERATOR_HEIGHT,
+ DEFAULT_BOX_GENERATOR_WIDTH,
MAX_BOX_GENERATOR_COMPARTMENTS,
MAX_BOX_GENERATOR_FIT,
+ MAX_BOX_GENERATOR_LATCHES,
+ MAX_BOX_GENERATOR_LATCH_GRIP,
+ MAX_BOX_GENERATOR_LATCH_WIDTH,
+ MIN_BOX_GENERATOR_LATCH_GRIP,
+ MIN_BOX_GENERATOR_LATCH_WIDTH,
+ boxGeneratorLatchHeight,
+ boxGeneratorMatchingLidPatch,
MAX_BOX_GENERATOR_STACK_HEIGHT,
MIN_BOX_GENERATOR_STACK_HEIGHT,
MAX_BOX_GENERATOR_SIDES,
@@ -224,6 +234,7 @@ import {
boxGeneratorMatchingLidSize,
normalizeBoxGenerator,
normalizeBoxGeneratorLidStyle,
+ normalizeBoxGeneratorLatchSides,
normalizeBoxGeneratorShape,
} from "@/lib/boxGeneratorGeometry";
import { MAX_DOVETAIL_CLEARANCE, maxDovetailNeckWidth, normalizeDovetailClearance, normalizeDovetailNeckWidth } from "@/lib/dovetailGeometry";
@@ -2653,16 +2664,30 @@ function getShapePropertiesWithAppLimits(shape: WorkplaneShape, onUpdate: ShapeI
: platePlan.plate
? t("boxGenerator.plateHint", { cells: String(platePlan.plate.cells.length), floor: plainNumber(platePlan.floorTop), box: t("prop.boxGridfinity") })
: t(platePlan.issues.some((issue) => issue.code === "plateTooLow") ? "boxGenerator.plateTooLow" : "boxGenerator.plateNoCell");
- const properties: ShapePropertyConfig[] = [
- {
- type: "select",
- id: "boxPart",
- label: t("prop.boxPart"),
- value: box.boxPart,
- options: [{ value: "box", label: t("boxGenerator.partBox") }, { value: "lid", label: t("boxGenerator.partLid") }],
- hint: t(box.boxPart === "box" ? "boxGenerator.partBoxHint" : "boxGenerator.partLidHint"),
- onChange: (value) => onUpdate({ boxPart: value === "lid" ? "lid" : "box" }),
+ const partSelect: ShapePropertyConfig = {
+ type: "select",
+ id: "boxPart",
+ label: t("prop.boxPart"),
+ value: box.boxPart,
+ options: [{ value: "box", label: t("boxGenerator.partBox") }, { value: "lid", label: t("boxGenerator.partLid") }, { value: "latch", label: t("boxGenerator.partLatch") }],
+ hint: t(box.boxPart === "box" ? "boxGenerator.partBoxHint" : box.boxPart === "lid" ? "boxGenerator.partLidHint" : "boxGenerator.partLatchHint"),
+ // The clip takes its size from its latch settings; a box or lid made from a clip starts at the generator's own size.
+ onChange: (value) => {
+ const part = value === "lid" || value === "latch" ? value : "box";
+ if (part === box.boxPart) return;
+ if (box.boxPart === "latch") {
+ const height = part === "lid" ? boxGeneratorMatchingLidPatch({ width: DEFAULT_BOX_GENERATOR_WIDTH, depth: DEFAULT_BOX_GENERATOR_DEPTH, height: DEFAULT_BOX_GENERATOR_HEIGHT }, shape).height : DEFAULT_BOX_GENERATOR_HEIGHT;
+ onUpdate({ boxPart: part, width: DEFAULT_BOX_GENERATOR_WIDTH, depth: DEFAULT_BOX_GENERATOR_DEPTH, height, size: resizedShapeSize(DEFAULT_BOX_GENERATOR_WIDTH, DEFAULT_BOX_GENERATOR_DEPTH) });
+ }
+ else onUpdate({ boxPart: part });
},
+ };
+ const latchWidth: ShapePropertyConfig = { id: "boxLatchWidth", label: t("prop.boxLatchWidth"), value: box.boxLatchWidth, min: MIN_BOX_GENERATOR_LATCH_WIDTH, max: MAX_BOX_GENERATOR_LATCH_WIDTH, step: 0.5, onChange: (value) => onUpdate({ boxLatchWidth: value }) };
+ const latchGrip: ShapePropertyConfig = { id: "boxLatchGrip", label: t("prop.boxLatchGrip"), value: box.boxLatchGrip, min: MIN_BOX_GENERATOR_LATCH_GRIP, max: MAX_BOX_GENERATOR_LATCH_GRIP, step: 0.05, hint: t("boxGenerator.latchGripHint"), onChange: (value) => onUpdate({ boxLatchGrip: value }) };
+ // The clip: its size comes from the latch settings alone, so only those are offered.
+ if (box.boxPart === "latch") return [partSelect, latchWidth, latchGrip];
+ const properties: ShapePropertyConfig[] = [
+ partSelect,
{
type: "select",
id: "boxShape",
@@ -2763,7 +2788,38 @@ function getShapePropertiesWithAppLimits(shape: WorkplaneShape, onUpdate: ShapeI
hint: t(box.boxLidStyle === "overlap" ? "boxGenerator.lidOverlapHint" : box.boxLidStyle === "plug" ? "boxGenerator.lidPlugHint" : "boxGenerator.lidRestOnHint"),
onChange: (value) => onUpdate({ boxLidStyle: normalizeBoxGeneratorLidStyle(value) }),
});
- if (box.boxPart === "lid" && (box.boxLidStyle === "overlap" || box.boxLidStyle === "plug" || (box.boxLidStyle === "restOn" && box.boxStackable))) {
+ // Latches: a pin with two cheeks on box and lid, and a clip that snaps over both (part Clip).
+ const latchIssue = issues.find((issue) => issue.code.startsWith("latch"));
+ const latchCount = box.boxLatches > 0 ? boxGeneratorPlan({ width, depth, height: shape.height }, shape).latches?.spots.length ?? 0 : 0;
+ properties.push({
+ id: "boxLatches",
+ label: t("prop.boxLatches"),
+ value: box.boxLatches,
+ min: 0,
+ max: MAX_BOX_GENERATOR_LATCHES,
+ step: 1,
+ hint: latchIssue
+ ? t(LATCH_ISSUE_KEYS[latchIssue.code as keyof typeof LATCH_ISSUE_KEYS], { height: plainNumber(boxGeneratorLatchHeight(box)) })
+ : box.boxLatches > 0
+ ? t("boxGenerator.latchHint", { count: String(latchCount) })
+ : undefined,
+ onChange: (value) => onUpdate({ boxLatches: Math.round(value) || undefined }),
+ });
+ if (box.boxLatches > 0) {
+ properties.push(
+ {
+ type: "select",
+ id: "boxLatchSides",
+ label: t("prop.boxLatchSides"),
+ value: box.boxLatchSides,
+ options: [{ value: "frontBack", label: t("boxGenerator.latchFrontBack") }, { value: "leftRight", label: t("boxGenerator.latchLeftRight") }, { value: "all", label: t("boxGenerator.latchAll") }],
+ onChange: (value) => onUpdate({ boxLatchSides: normalizeBoxGeneratorLatchSides(value) }),
+ },
+ latchWidth,
+ latchGrip,
+ );
+ }
+ if (box.boxPart === "lid" && (box.boxLidStyle === "overlap" || box.boxLidStyle === "plug" || (box.boxLidStyle === "restOn" && (box.boxStackable || box.boxLatches > 0)))) {
properties.push({ id: "boxLidPlate", label: t("prop.boxLidPlate"), value: box.boxLidPlate, min: MIN_BOX_GENERATOR_WALL, max: Math.max(MIN_BOX_GENERATOR_WALL, shape.height - 0.5), step: 0.1, onChange: (value) => onUpdate({ boxLidPlate: value }) });
}
if (box.boxLidStyle === "overlap" || (box.boxPart === "lid" && box.boxLidStyle === "plug") || (box.boxStackable && (box.boxPart === "box" || box.boxLidStyle === "restOn"))) {
@@ -4578,6 +4634,15 @@ function getShapeProperties(shape: WorkplaneShape, onUpdate: ShapeInspectorUpdat
*/
const SliderSnapContext = createContext(0);
+/** The panel's text for each reason a box generator's latches cannot be made. */
+const LATCH_ISSUE_KEYS = {
+ latchLidStyle: "boxGenerator.issueLatchLidStyle",
+ latchOutline: "boxGenerator.issueLatchOutline",
+ latchNoRoom: "boxGenerator.issueLatchNoRoom",
+ latchLow: "boxGenerator.issueLatchLow",
+ latchCurved: "boxGenerator.issueLatchCurved",
+} as const;
+
export function ShapeInspector({
shape,
snap,
@@ -4608,6 +4673,7 @@ export function ShapeInspector({
onVaseAccessories,
onGridfinityKeys,
onMakeBoxLid,
+ onMakeBoxLatches,
onLayerText,
onTextTags,
onTextBlock,
@@ -4668,6 +4734,7 @@ export function ShapeInspector({
onGridfinityKeys?: () => void;
/** A box generator box: lays out a matching lid beside it, with the box's own outline, wall, play and stacking. */
onMakeBoxLid?: () => void;
+ onMakeBoxLatches?: () => void;
/** Splits a text into layers, or builds a layered text again with new words, font or layers (#215). */
onLayerText?: (patch: TextLayerPatch) => void;
/** One tag like this text or stack per name, laid out in rows (#215). */
@@ -5650,7 +5717,7 @@ export function ShapeInspector({
) : null}
>
) : null}
- {shape.kind === "boxGenerator" && shape.boxPart !== "lid" && onMakeBoxLid ? (
+ {shape.kind === "boxGenerator" && shape.boxPart !== "lid" && shape.boxPart !== "latch" && onMakeBoxLid ? (
<>