diff --git a/.agents/skills/formblocks-driving/SKILL.md b/.agents/skills/formblocks-driving/SKILL.md
index 906173e..41713d7 100644
--- a/.agents/skills/formblocks-driving/SKILL.md
+++ b/.agents/skills/formblocks-driving/SKILL.md
@@ -1,10 +1,10 @@
---
name: formblocks-driving
-description: "Use when asked to build, stack, change, check, picture or save a brick model in FormBlocks through its MCP tools or ./formblocks cli: a wall, a tower, a house, a table, any LDraw model. Finds parts and colours in the LDraw parts library, places and seats bricks, clips and hinge halves on placements or the ground, builds walls in overlapping courses with plates, tiles and slopes, moves, turns, duplicates and recolours parts, uses the selection and submodels, splits a model into steps and walks them, counts parts and saves the parts list as CSV, saves PNG pictures and reads them back to check a build, checks overlaps, and opens, saves and exports .fblk, .ldr and .mpd files. Covers Claude Code, Codex, Cursor and Antigravity in the agent dock or outside it, and the person's approval, which an agent never gives itself. Includes worked examples, coordinates, error codes and scripts. Not for changing FormBlocks' source code or installing it (formblocks-harness)."
+description: "Use when asked to build, stack, change, check, picture or save a brick model in FormBlocks through its MCP tools or ./formblocks cli: a wall, a tower, a house, a table, any LDraw model. Finds parts and colours in the LDraw parts library, places and seats bricks, clips and hinge halves on placements or the ground, builds walls in overlapping courses with plates, tiles and slopes, moves, turns, duplicates, copies, pastes and recolours parts, uses the selection and submodels, splits a model into steps and walks them, counts parts and saves the parts list as CSV, saves PNG pictures and reads them back to check a build, checks overlaps, and opens, saves and exports .fblk, .ldr and .mpd files. Covers Claude Code, Codex, Cursor and Antigravity in the agent dock or outside it, and the person's approval, which an agent never gives itself. Includes worked examples, coordinates, error codes and scripts. Not for changing FormBlocks' source code or installing it (formblocks-harness)."
license: Apache-2.0
metadata:
product: FormBlocks
- pack-version: "0.5.0"
+ pack-version: "0.6.0"
audience: operating agent
---
@@ -23,6 +23,8 @@ FormBlocks keeps one open model in its engine: submodels holding placements of L
| Clips on bars, hinge halves, hinge plates and bricks, swivel plates, sliding a clip, folding a hinge, part.connectors kinds | `sub-skills/clips-and-hinges/SUB-SKILL.md` |
| Planning a build, walls in overlapping courses, corners, openings, plates and tiles, roofs of slopes | `sub-skills/building-in-order/SUB-SKILL.md` |
| Moving, turning, duplicating, recolouring, hiding, showing and deleting placements, undo and redo | `sub-skills/changing-parts/SUB-SKILL.md` |
+| Beams with holes, pins, friction pins, axles, bushes, a brick with a hole, joining beams, turning a beam on a pin | `sub-skills/pins-and-axles/SUB-SKILL.md` |
+| Copying, cutting and pasting parts as LDraw lines, repeating a group at an offset, clipboard.copy, clipboard.cut, clipboard.paste | `sub-skills/clipboard/SUB-SKILL.md` |
| Turning parts by any angle, about a point, an axis or a hinge's axis, part.pivot, the angle step, a turn lifted or refused | `sub-skills/turning-parts/SUB-SKILL.md` |
| Moving or copying parts along a pointer ray as the window drags them, part.pick, the scene's axes, resting across a gap, what the person's drags and Ctrl+D do | `sub-skills/moving-parts/SUB-SKILL.md` |
| Reading and setting the selection, selecting by colour or part, showing the person which parts | `sub-skills/selection/SUB-SKILL.md` |
diff --git a/.agents/skills/formblocks-driving/references/command-catalogue.md b/.agents/skills/formblocks-driving/references/command-catalogue.md
index 9c9f875..7c1baaf 100644
--- a/.agents/skills/formblocks-driving/references/command-catalogue.md
+++ b/.agents/skills/formblocks-driving/references/command-catalogue.md
@@ -4,8 +4,8 @@ Written by `./formblocks agents sync` from the engine's command catalogue; never
## Contents
-- MCP tools: the 72 tools an agent sees, each with whether it only reads.
-- Commands: the 66 catalogue commands with their titles, parameters and summaries, in name order.
+- MCP tools: the 85 tools an agent sees, each with whether it only reads.
+- Commands: the 79 catalogue commands with their titles, parameters and summaries, in name order.
## MCP tools
@@ -17,10 +17,16 @@ Written by `./formblocks agents sync` from the engine's command catalogue; never
| `formblocks_redo` | no | Redo changes that formblocks_undo took back, one step each. A new change after an undo empties what can be redone. Returns {revision, labels, label}. |
| `formblocks_status` | yes | Read what this FormBlocks is: its version, the model's revision, placement count, file and unsaved mark, how many commands there are, its data folder, whether the window's engine is running, and the person's standing choice for outside agents (ask, allowed or blocked). Call it first. |
| `formblocks_undo` | no | Undo the last changes, one step per command. Returns {revision, labels, label}: the new revision and the titles of the commands taken back, newest first. Nothing to undo answers an empty labels list. |
+| `cmd_angle_next` | yes | Go to the next angle step after the engine's own: 90, 45, 22.5, 15, 5, 1 degrees, then 90 again. Kept as the person's setting. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
| `cmd_angle_step` | yes | Choose the angle step a turn with the pointer moves in and Alt with R, T or Y turns by: 90, 45, 22.5, 15, 5 or 1 degrees. Kept as the person's setting. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
+| `cmd_clipboard_copy` | yes | Write placements as LDraw part lines (type 1, colour, position, rotation, file name), the text the window puts on the system clipboard; the engine keeps it too, for clipboard.paste without text. Only reads. |
+| `cmd_clipboard_cut` | no | Copy placements as LDraw part lines, as clipboard.copy does, and remove them from the model. One undo step. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
+| `cmd_clipboard_paste` | no | Add the parts that LDraw part lines name, keeping their colours and their places relative to one another, into the step shown of the submodel being edited; they become the selection. With a pointer ray in the window's scene axes they go where the ray takes the lowest of them, seated, resting or refused exactly as a drag of copies; without one they go where the lines put them, moved by delta. One undo step. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
| `cmd_colours_current` | yes | Choose the colour the next placed part gets, and put it at the front of the recent colours. Kept as the person's setting; it recolours nothing. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
+| `cmd_colours_favourite` | yes | Star or unstar a colour: a starred colour is listed among the favourite colours, newest first. Left out, on turns the star the other way. Kept as the person's setting; it changes no model. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
| `cmd_colours_list` | yes | List the library's colours with code, name, value, edge and finish, or the swatches of one group, hue family or name words. Only reads. |
| `cmd_colours_used` | yes | List the colours used in the open model, most used first: each colour's number, name, value, how many parts of the whole model are in it, and whether the library defines it. Only reads. |
+| `cmd_grid_next` | yes | Go to the next grid step after the engine's own: stud, plate, fine, then stud again. Kept as the person's setting. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
| `cmd_grid_step` | yes | Choose the grid step: stud (20 LDU across, 8 up), plate (10 across, 8 up) or fine (1 and 1). Kept as the person's setting. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
| `cmd_library_status` | yes | Read whether a parts library is in use, where it was found, its update, whether its index is ready, the fetch in progress if any, and the consent and attribution the library card shows. Reading never fetches; only the person can consent to a fetch. Only reads. |
| `cmd_model_info` | yes | Read the model's name, description (its title line), author, file, format and the library update it was saved with and the one in use; its counts (placements, parts through every use, different parts, colours, part and colour pairs, submodels, steps, missing parts, and overlapping pairs as overlap.check counts them); the parts the library lacks by number; its size in LDU, studs, bricks and millimetres; the licences model.set_info accepts; and its parts list unless table is false. Only reads. |
@@ -35,7 +41,9 @@ Written by `./formblocks agents sync` from the engine's command catalogue; never
| `cmd_model_tree` | yes | Read one submodel's steps and placements, each with its id, part, colour, position, rotation, step and hidden mark, and the submodels with their uses. Only reads. |
| `cmd_overlap_check` | yes | List each pair of overlapping placements, for the given placements or the whole model: two parts whose real shapes cut more than 1 LDU into each other, with the depth in LDU and the shared volume in cubic LDU. Parts joined through seated connectors never count. Nested pairs, one part sitting in another's hollow by design, are counted apart in nested_count and listed under nested when asked. Only reads. |
| `cmd_overlap_nested` | yes | Choose what the overlap check reports: false reports only real overlaps (the proposed default), true reports nested pairs too, parts that sit in another's hollow by design, such as a rim in its tyre or a pin in its hole. Nested pairs never block placing or moving either way. Kept as the person's setting. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
+| `cmd_overlap_nested_toggle` | yes | Turn the reporting of nested pairs off when it is on and on when it is off, deciding from the engine's own setting. Kept as the person's setting. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
| `cmd_overlap_set` | yes | Turn the overlap check on or off: with it on, placing and moving never put a part where its real shape would cut more than 1 LDU into another's. Kept as the person's setting. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
+| `cmd_overlap_toggle` | yes | Turn the overlap check off when it is on and on when it is off, deciding from the engine's own setting, so two quick presses always end where they began. Kept as the person's setting. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
| `cmd_part_connectors` | yes | List a library part's connectors as the connection model derives them: kind, position, axis, ref, length, index and where each came from, with the counts, the body box and the footprint; kind keeps only connectors of one kind. Only reads. |
| `cmd_part_delete` | no | Remove placements from the model; deleting the last use of a submodel keeps the submodel. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
| `cmd_part_duplicate` | no | Copy placements, keeping colours and relative places, offset by delta; the copies go into the step shown and become the selection. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
@@ -43,7 +51,7 @@ Written by `./formblocks agents sync` from the engine's command catalogue; never
| `cmd_part_fit` | yes | Answer where a part would go and which connectors it would join, from a position, a placement to seat on, or a pointer ray, with snapping, the grid step and the overlap check as set; changes nothing. Position and rotation are in LDraw axes (-Y up); a pointer ray is in the window's scene axes (+Y up), as for every command that takes one. Only reads. |
| `cmd_part_hide` | no | Hide placements: they stay in the model but are not drawn or picked, and the project file remembers it. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
| `cmd_part_hide_others` | no | Hide every placement of the submodel being edited except the given ones or the selection, to work on one area alone. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
-| `cmd_part_move` | no | Move placements by an offset in LDU, exactly, with no snapping. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
+| `cmd_part_move` | no | Move placements by an offset in LDU, exactly, with no snapping; with the overlap check on, a move into a part that does not move is refused. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
| `cmd_part_move_at_ray` | no | Put down a dragged selection where a pointer ray in the window's scene axes takes the grabbed placement, seated, on the grid or refused exactly as the drag preview answers, resting on what lies under its footprint when the place under the pointer would cut into another part; the others keep their places relative to it. Give held as the drag preview answered it so the part lands as previewed. One undo step. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
| `cmd_part_pick` | yes | Name the placement of the submodel being edited that a pointer ray in the window's scene axes meets first on its real triangles, with the point and the face's normal, or the ground; hidden parts are passed through. Only reads. |
| `cmd_part_pivot` | yes | Say what placements turn about when the pivot dial turns them: the centre of the box around their shapes with the X, Y and Z axes, or, for one part joined by a hinge, the hinge's point and axis alone; with a pointer ray, the point where it meets a part of the submodel being edited (or the connector within 8 LDU of it), with X, Y and Z, and as without a ray when it meets none. Each point and axis in LDraw's axes and in the window's scene axes, with how far the box reaches from the point. Only reads. |
@@ -51,7 +59,7 @@ Written by `./formblocks agents sync` from the engine's command catalogue; never
| `cmd_part_place_at_ray` | no | Place a library part where a pointer ray in the window's scene axes puts it, seated, on the grid or refused exactly as the placement preview answers, resting on what lies under its whole footprint when the place under the pointer would cut into another part; it goes into the step shown of the submodel being edited and becomes the selection. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
| `cmd_part_recolour` | no | Give placements a colour; a use of a submodel in colour 16 passes it to its parts in colour 16. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
| `cmd_part_rotate` | no | Turn placements about an axis through a point: by whole quarter turns, or by an angle in degrees, about X, Y, Z or any direction in LDraw axes, about the centre of their box when no point is given. What turned is lifted straight up when it would end below the ground, and with the overlap check on a turn into a part that does not turn is refused. One undo step. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
-| `cmd_part_set_transform` | no | Put one placement at an exact position, rotation or both, as the details panel does. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
+| `cmd_part_set_transform` | no | Put one placement at an exact position, rotation or both, as the details panel does; with the overlap check on, a place inside another part is refused. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
| `cmd_part_show` | no | Show hidden placements again; every hidden placement in the model when no ids are given (Show all). Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
| `cmd_parts_list` | yes | Read the parts a model needs, one row per part and colour with its description, colour name, count and the placements of the submodel being edited that hold it; a submodel's parts counted once for each use unless submodels is row, a moved part counted under the number it moved to, parts missing from the library first and marked. With text true the answer also holds the list as tab separated text. Only reads. |
| `cmd_parts_list_save` | no | Write the parts list to a file as CSV in UTF-8 with a byte order mark and CR LF line ends: a header row, then one row per part and colour with LDraw part number, description, LDraw colour number, colour name and count; comma separated, or tab separated for a .tsv path or separator tab. A cell starting with =, +, - or @ is written after an apostrophe so a spreadsheet reads it as text. Opens, starts or writes a model file; not an undo step. An outside agent waits for the person to allow it in the window. |
@@ -61,20 +69,25 @@ Written by `./formblocks agents sync` from the engine's command catalogue; never
| `cmd_picture_steps` | no | Draw one PNG for every step of the submodel being edited, each showing the steps up to it, and write them into a folder as name-01.png, name-02.png and so on. Needs the FormBlocks window open. Opens, starts or writes a model file; not an undo step. An outside agent waits for the person to allow it in the window. |
| `cmd_select_add` | yes | Add placements to the selection. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
| `cmd_select_all` | yes | Select every visible placement of the submodel being edited. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
+| `cmd_select_attached` | yes | Select the given placements, or the selection, and every visible placement joined to them through seated connectors, however far the chain goes; a use of a submodel joins nothing. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
| `cmd_select_by_colour` | yes | Select every visible placement in a colour, or in the colours of the selection when no colour is given. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
| `cmd_select_by_part` | yes | Select every visible placement of a part, or of the parts of the selection when no part is given; a printed part is a different part. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
+| `cmd_select_by_part_colour` | yes | Select every visible placement that matches one of the given placements, or of the selection, in both its part and its colour; a printed part is a different part. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
| `cmd_select_clear` | yes | Clear the selection. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
| `cmd_select_get` | yes | Read the selection: the placements, how many, in how many colours, and the centre of their origins. Only reads. |
| `cmd_select_invert` | yes | Select every visible placement that was not selected and let go of the rest. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
| `cmd_select_remove` | yes | Let go of placements without touching the rest of the selection. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
| `cmd_select_set` | yes | Make the selection exactly these placements; an empty list clears it. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
| `cmd_snap_set` | yes | Turn snapping on or off: with it on, a part being placed or moved seats on free compatible connectors within reach; with it off, it moves in grid steps only. Kept as the person's setting. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
+| `cmd_snap_toggle` | yes | Turn snapping off when it is on and on when it is off, deciding from the engine's own setting, so two quick presses always end where they began. Kept as the person's setting. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
| `cmd_step_break_after` | no | Start a new step after a placement, moving the placements after it in its step into the new step; with no id, add an empty step after the step shown and show it. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
| `cmd_step_delete` | no | Delete a step; its placements move to the start of the next step, or to the end of the step before when it is the last. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
| `cmd_step_goto` | yes | Show a step of the submodel being edited, by number or as first, previous, next or last: every placement of steps 1 to it is drawn, later ones are hidden, and new parts go into it. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
| `cmd_step_list` | yes | Read the steps of a submodel: each step's number, name and placement ids, and which step is shown. Only reads. |
| `cmd_step_move_parts` | no | Move placements of one submodel into another of its steps; one past the last step starts a new step at the end. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
+| `cmd_step_move_to_new` | no | Put placements of one submodel into a new step right after the step shown, and show it. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
| `cmd_step_rename` | no | Name a step, or clear its name with an empty name; the name is kept in the file as the step's first line. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
+| `cmd_step_reorder` | no | Move a step with everything in it to another place in its submodel's order; the steps between close up and are numbered again. The step shown stays the same step. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
| `cmd_submodel_create` | no | Pack placements of one submodel into a new submodel and put one use of it in their place. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
| `cmd_submodel_delete` | no | Delete a submodel that is not the main model; one that still has uses is kept unless with_uses is true, which deletes the uses too. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
| `cmd_submodel_dissolve` | no | Put a use's parts back into its parent at the same places, in the use's step; the submodel goes when its last use is unpacked. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
@@ -88,10 +101,16 @@ Written by `./formblocks agents sync` from the engine's command catalogue; never
| Command | Title | Reads only | Parameters | What it does |
| --- | --- | --- | --- | --- |
+| `angle.next` | Next Angle Step | yes | none | Go to the next angle step after the engine's own: 90, 45, 22.5, 15, 5, 1 degrees, then 90 again. Kept as the person's setting. |
| `angle.step` | Angle Step | yes | `step` (number) | Choose the angle step a turn with the pointer moves in and Alt with R, T or Y turns by: 90, 45, 22.5, 15, 5 or 1 degrees. Kept as the person's setting. |
+| `clipboard.copy` | Copy | yes | `ids` (array, optional) | Write placements as LDraw part lines (type 1, colour, position, rotation, file name), the text the window puts on the system clipboard; the engine keeps it too, for clipboard.paste without text. |
+| `clipboard.cut` | Cut | no | `ids` (array, optional) | Copy placements as LDraw part lines, as clipboard.copy does, and remove them from the model. One undo step. |
+| `clipboard.paste` | Paste | no | `text` (string, optional), `origin` (array, optional), `direction` (array, optional), `rotation` (array, optional), `held` (integer, optional), `snap` (boolean, optional), `delta` (array, optional) | Add the parts that LDraw part lines name, keeping their colours and their places relative to one another, into the step shown of the submodel being edited; they become the selection. With a pointer ray in the window's scene axes they go where the ray takes the lowest of them, seated, resting or refused exactly as a drag of copies; without one they go where the lines put them, moved by delta. One undo step. |
| `colours.current` | Current Colour | yes | `colour` (integer) | Choose the colour the next placed part gets, and put it at the front of the recent colours. Kept as the person's setting; it recolours nothing. |
+| `colours.favourite` | Favourite Colour | yes | `colour` (integer), `on` (boolean, optional) | Star or unstar a colour: a starred colour is listed among the favourite colours, newest first. Left out, on turns the star the other way. Kept as the person's setting; it changes no model. |
| `colours.list` | Colours | yes | `text` (string, optional), `group` (string, optional), `hue` (string, optional) | List the library's colours with code, name, value, edge and finish, or the swatches of one group, hue family or name words. |
| `colours.used` | Colours Used | yes | none | List the colours used in the open model, most used first: each colour's number, name, value, how many parts of the whole model are in it, and whether the library defines it. |
+| `grid.next` | Next Grid Step | yes | none | Go to the next grid step after the engine's own: stud, plate, fine, then stud again. Kept as the person's setting. |
| `grid.step` | Grid Step | yes | `step` (string) | Choose the grid step: stud (20 LDU across, 8 up), plate (10 across, 8 up) or fine (1 and 1). Kept as the person's setting. |
| `library.status` | Library Status | yes | none | Read whether a parts library is in use, where it was found, its update, whether its index is ready, the fetch in progress if any, and the consent and attribution the library card shows. Reading never fetches; only the person can consent to a fetch. |
| `model.info` | Model Information | yes | `table` (boolean, optional) | Read the model's name, description (its title line), author, file, format and the library update it was saved with and the one in use; its counts (placements, parts through every use, different parts, colours, part and colour pairs, submodels, steps, missing parts, and overlapping pairs as overlap.check counts them); the parts the library lacks by number; its size in LDU, studs, bricks and millimetres; the licences model.set_info accepts; and its parts list unless table is false. |
@@ -106,7 +125,9 @@ Written by `./formblocks agents sync` from the engine's command catalogue; never
| `model.tree` | Model Tree | yes | `submodel` (string, optional) | Read one submodel's steps and placements, each with its id, part, colour, position, rotation, step and hidden mark, and the submodels with their uses. |
| `overlap.check` | Check Overlaps | yes | `ids` (array, optional), `nested` (boolean, optional) | List each pair of overlapping placements, for the given placements or the whole model: two parts whose real shapes cut more than 1 LDU into each other, with the depth in LDU and the shared volume in cubic LDU. Parts joined through seated connectors never count. Nested pairs, one part sitting in another's hollow by design, are counted apart in nested_count and listed under nested when asked. |
| `overlap.nested` | Nested Pairs | yes | `on` (boolean) | Choose what the overlap check reports: false reports only real overlaps (the proposed default), true reports nested pairs too, parts that sit in another's hollow by design, such as a rim in its tyre or a pin in its hole. Nested pairs never block placing or moving either way. Kept as the person's setting. |
+| `overlap.nested_toggle` | Nested Pairs On or Off | yes | none | Turn the reporting of nested pairs off when it is on and on when it is off, deciding from the engine's own setting. Kept as the person's setting. |
| `overlap.set` | Overlap Check | yes | `on` (boolean) | Turn the overlap check on or off: with it on, placing and moving never put a part where its real shape would cut more than 1 LDU into another's. Kept as the person's setting. |
+| `overlap.toggle` | Overlap Check On or Off | yes | none | Turn the overlap check off when it is on and on when it is off, deciding from the engine's own setting, so two quick presses always end where they began. Kept as the person's setting. |
| `part.connectors` | Part Connectors | yes | `part` (string), `kind` (string, optional) | List a library part's connectors as the connection model derives them: kind, position, axis, ref, length, index and where each came from, with the counts, the body box and the footprint; kind keeps only connectors of one kind. |
| `part.delete` | Delete | no | `ids` (array, optional) | Remove placements from the model; deleting the last use of a submodel keeps the submodel. |
| `part.duplicate` | Duplicate | no | `ids` (array, optional), `delta` (array, optional) | Copy placements, keeping colours and relative places, offset by delta; the copies go into the step shown and become the selection. |
@@ -114,7 +135,7 @@ Written by `./formblocks agents sync` from the engine's command catalogue; never
| `part.fit` | Fit Part | yes | `part` (string), `rotation` (array, optional), `position` (array, optional), `on` (string, optional), `origin` (array, optional), `direction` (array, optional), `ids` (array, optional), `submodel` (string, optional), `snap` (boolean, optional) | Answer where a part would go and which connectors it would join, from a position, a placement to seat on, or a pointer ray, with snapping, the grid step and the overlap check as set; changes nothing. Position and rotation are in LDraw axes (-Y up); a pointer ray is in the window's scene axes (+Y up), as for every command that takes one. |
| `part.hide` | Hide | no | `ids` (array, optional) | Hide placements: they stay in the model but are not drawn or picked, and the project file remembers it. |
| `part.hide_others` | Hide Others | no | `ids` (array, optional) | Hide every placement of the submodel being edited except the given ones or the selection, to work on one area alone. |
-| `part.move` | Move | no | `ids` (array, optional), `delta` (array) | Move placements by an offset in LDU, exactly, with no snapping. |
+| `part.move` | Move | no | `ids` (array, optional), `delta` (array) | Move placements by an offset in LDU, exactly, with no snapping; with the overlap check on, a move into a part that does not move is refused. |
| `part.move_at_ray` | Move Selection at Pointer | no | `grab` (string), `origin` (array), `direction` (array), `rotation` (array, optional), `held` (integer, optional), `ids` (array, optional), `snap` (boolean, optional) | Put down a dragged selection where a pointer ray in the window's scene axes takes the grabbed placement, seated, on the grid or refused exactly as the drag preview answers, resting on what lies under its footprint when the place under the pointer would cut into another part; the others keep their places relative to it. Give held as the drag preview answered it so the part lands as previewed. One undo step. |
| `part.pick` | Pick at Pointer | yes | `origin` (array), `direction` (array), `ground` (boolean, optional) | Name the placement of the submodel being edited that a pointer ray in the window's scene axes meets first on its real triangles, with the point and the face's normal, or the ground; hidden parts are passed through. |
| `part.pivot` | Pivot | yes | `ids` (array, optional), `origin` (array, optional), `direction` (array, optional) | Say what placements turn about when the pivot dial turns them: the centre of the box around their shapes with the X, Y and Z axes, or, for one part joined by a hinge, the hinge's point and axis alone; with a pointer ray, the point where it meets a part of the submodel being edited (or the connector within 8 LDU of it), with X, Y and Z, and as without a ray when it meets none. Each point and axis in LDraw's axes and in the window's scene axes, with how far the box reaches from the point. |
@@ -122,7 +143,7 @@ Written by `./formblocks agents sync` from the engine's command catalogue; never
| `part.place_at_ray` | Place Part at Pointer | no | `part` (string), `colour` (integer), `origin` (array), `direction` (array), `rotation` (array, optional), `held` (integer, optional), `step` (integer, optional), `snap` (boolean, optional) | Place a library part where a pointer ray in the window's scene axes puts it, seated, on the grid or refused exactly as the placement preview answers, resting on what lies under its whole footprint when the place under the pointer would cut into another part; it goes into the step shown of the submodel being edited and becomes the selection. |
| `part.recolour` | Recolour | no | `ids` (array, optional), `colour` (integer) | Give placements a colour; a use of a submodel in colour 16 passes it to its parts in colour 16. |
| `part.rotate` | Rotate | no | `ids` (array, optional), `axis` (string, optional), `quarter_turns` (integer, optional), `angle` (number, optional), `axis_vector` (array, optional), `about` (array, optional) | Turn placements about an axis through a point: by whole quarter turns, or by an angle in degrees, about X, Y, Z or any direction in LDraw axes, about the centre of their box when no point is given. What turned is lifted straight up when it would end below the ground, and with the overlap check on a turn into a part that does not turn is refused. One undo step. |
-| `part.set_transform` | Set Position and Rotation | no | `id` (string), `position` (array, optional), `rotation` (array, optional) | Put one placement at an exact position, rotation or both, as the details panel does. |
+| `part.set_transform` | Set Position and Rotation | no | `id` (string), `position` (array, optional), `rotation` (array, optional) | Put one placement at an exact position, rotation or both, as the details panel does; with the overlap check on, a place inside another part is refused. |
| `part.show` | Show | no | `ids` (array, optional) | Show hidden placements again; every hidden placement in the model when no ids are given (Show all). |
| `parts.list` | Parts List | yes | `scope` (string, optional), `group` (string, optional), `submodels` (string, optional), `text` (boolean, optional) | Read the parts a model needs, one row per part and colour with its description, colour name, count and the placements of the submodel being edited that hold it; a submodel's parts counted once for each use unless submodels is row, a moved part counted under the number it moved to, parts missing from the library first and marked. With text true the answer also holds the list as tab separated text. |
| `parts.list_save` | Save Parts List | no | `path` (string), `separator` (string, optional), `scope` (string, optional), `group` (string, optional), `submodels` (string, optional) | Write the parts list to a file as CSV in UTF-8 with a byte order mark and CR LF line ends: a header row, then one row per part and colour with LDraw part number, description, LDraw colour number, colour name and count; comma separated, or tab separated for a .tsv path or separator tab. A cell starting with =, +, - or @ is written after an apostrophe so a spreadsheet reads it as text. |
@@ -132,20 +153,25 @@ Written by `./formblocks agents sync` from the engine's command catalogue; never
| `picture.steps` | Save Step Pictures | no | `folder` (string), `name` (string, optional), `width` (integer, optional), `height` (integer, optional), `scale` (integer, optional), `background` (string, optional), `ground` (boolean, optional), `view` (string, optional), `fade` (boolean, optional) | Draw one PNG for every step of the submodel being edited, each showing the steps up to it, and write them into a folder as name-01.png, name-02.png and so on. Needs the FormBlocks window open. |
| `select.add` | Add to Selection | yes | `ids` (array) | Add placements to the selection. |
| `select.all` | Select All | yes | none | Select every visible placement of the submodel being edited. |
-| `select.by_colour` | Select Same Colour | yes | `colour` (integer, optional) | Select every visible placement in a colour, or in the colours of the selection when no colour is given. |
-| `select.by_part` | Select Same Part | yes | `part` (string, optional) | Select every visible placement of a part, or of the parts of the selection when no part is given; a printed part is a different part. |
+| `select.attached` | Select Attached | yes | `ids` (array, optional), `add` (boolean, optional) | Select the given placements, or the selection, and every visible placement joined to them through seated connectors, however far the chain goes; a use of a submodel joins nothing. |
+| `select.by_colour` | Select Same Colour | yes | `colour` (integer, optional), `add` (boolean, optional) | Select every visible placement in a colour, or in the colours of the selection when no colour is given. |
+| `select.by_part` | Select Same Part | yes | `part` (string, optional), `add` (boolean, optional) | Select every visible placement of a part, or of the parts of the selection when no part is given; a printed part is a different part. |
+| `select.by_part_colour` | Select Same Part and Colour | yes | `ids` (array, optional), `add` (boolean, optional) | Select every visible placement that matches one of the given placements, or of the selection, in both its part and its colour; a printed part is a different part. |
| `select.clear` | Select None | yes | none | Clear the selection. |
| `select.get` | Selection | yes | none | Read the selection: the placements, how many, in how many colours, and the centre of their origins. |
| `select.invert` | Invert Selection | yes | none | Select every visible placement that was not selected and let go of the rest. |
| `select.remove` | Remove from Selection | yes | `ids` (array) | Let go of placements without touching the rest of the selection. |
| `select.set` | Select | yes | `ids` (array) | Make the selection exactly these placements; an empty list clears it. |
| `snap.set` | Snapping | yes | `on` (boolean) | Turn snapping on or off: with it on, a part being placed or moved seats on free compatible connectors within reach; with it off, it moves in grid steps only. Kept as the person's setting. |
+| `snap.toggle` | Snapping On or Off | yes | none | Turn snapping off when it is on and on when it is off, deciding from the engine's own setting, so two quick presses always end where they began. Kept as the person's setting. |
| `step.break_after` | New Step | no | `id` (string, optional) | Start a new step after a placement, moving the placements after it in its step into the new step; with no id, add an empty step after the step shown and show it. |
| `step.delete` | Delete Step | no | `step` (integer), `submodel` (string, optional) | Delete a step; its placements move to the start of the next step, or to the end of the step before when it is the last. |
| `step.goto` | Show Step | yes | `index` (integer, optional), `to` (string, optional) | Show a step of the submodel being edited, by number or as first, previous, next or last: every placement of steps 1 to it is drawn, later ones are hidden, and new parts go into it. |
| `step.list` | Steps | yes | `submodel` (string, optional) | Read the steps of a submodel: each step's number, name and placement ids, and which step is shown. |
| `step.move_parts` | Move to Step | no | `ids` (array, optional), `step` (integer) | Move placements of one submodel into another of its steps; one past the last step starts a new step at the end. |
+| `step.move_to_new` | Move to New Step | no | `ids` (array, optional) | Put placements of one submodel into a new step right after the step shown, and show it. |
| `step.rename` | Rename Step | no | `step` (integer), `name` (string), `submodel` (string, optional) | Name a step, or clear its name with an empty name; the name is kept in the file as the step's first line. |
+| `step.reorder` | Move Step | no | `step` (integer), `to` (integer), `submodel` (string, optional) | Move a step with everything in it to another place in its submodel's order; the steps between close up and are numbered again. The step shown stays the same step. |
| `submodel.create` | Pack | no | `ids` (array, optional), `name` (string) | Pack placements of one submodel into a new submodel and put one use of it in their place. |
| `submodel.delete` | Delete Submodel | no | `name` (string), `with_uses` (boolean, optional) | Delete a submodel that is not the main model; one that still has uses is kept unless with_uses is true, which deletes the uses too. |
| `submodel.dissolve` | Unpack | no | `id` (string, optional) | Put a use's parts back into its parent at the same places, in the use's step; the submodel goes when its last use is unpacked. |
diff --git a/.agents/skills/formblocks-driving/sub-skills/clipboard/SUB-SKILL.md b/.agents/skills/formblocks-driving/sub-skills/clipboard/SUB-SKILL.md
new file mode 100644
index 0000000..eafa723
--- /dev/null
+++ b/.agents/skills/formblocks-driving/sub-skills/clipboard/SUB-SKILL.md
@@ -0,0 +1,38 @@
+---
+name: clipboard
+description: Copies, cuts and pastes parts in a FormBlocks model as LDraw part lines with clipboard.copy, clipboard.cut and clipboard.paste. Use when asked to repeat a group of parts somewhere else, move a built unit by a fixed offset, paste parts given as LDraw text, or take parts out of one place to put them down in another, and when a paste is refused or lands on top of the original.
+---
+
+# Clipboard
+
+The clipboard holds LDraw part lines: one line per placement, `1 colour x y z a b c d e f g h i part.dat`, in LDraw's axes with -Y up. It is the same text the window puts on the system clipboard with Ctrl+C, so parts copied here paste into other LDraw programs and the other way round. The engine keeps the last copy too, so a paste with no `text` uses it.
+
+## The three commands
+
+| Command | Kind | What it does |
+| --- | --- | --- |
+| `clipboard.copy` | read | Answers `{text, count}` for the placements in `ids` (the selection when left out). Changes nothing. |
+| `clipboard.cut` | change | The same answer, and removes the placements: one undo step. |
+| `clipboard.paste` | change | Adds the parts of the lines in `text` (or the engine's last copy) to the step shown of the submodel being edited, keeping colours and the places of the parts relative to each other, and selects them. |
+
+`paste` takes one placing rule:
+
+- `delta` `[x, y, z]`: the whole group moves by that offset in LDU. `delta [0, 0, 0]` puts the copies exactly on the originals, which is almost never what you want; with the overlap check on it is refused: "delta: the copies would overlap p1 by 24.0 LDU with the overlap check on, so nothing was pasted."
+- `origin` and `direction` (a pointer ray in the scene's axes), with `held`, `rotation` and `snap`: seat the group the way the window seats copies held under the pointer. Use this to let snapping find the studs; use `delta` when you know the place.
+
+```bash
+./formblocks cli run clipboard.copy 'ids=["p1","p2"]'
+./formblocks cli run clipboard.paste 'delta=[100,0,0]'
+./formblocks cli run clipboard.paste text=nonsense
+```
+
+The copy answered `count` 2 and the text of two lines; the paste with `delta [100, 0, 0]` answered two placements 100 LDU along X, in the step shown, with new ids; `text=nonsense` was refused with "text: there is no LDraw part line (a line starting with 1) to paste." and changed nothing.
+
+## Traps
+
+- New ids: the pasted parts are new placements (`p3`, `p4`), never the originals. Read their ids from the answer.
+- Paste goes into the step shown and the submodel being edited. Give nothing for them: set the step first with `step.goto`, or move the parts afterwards with `step.move_parts`.
+- A paste copies parts, never a part file's own lines, and lines that do not start with `1` are ignored.
+- A pasted group is not checked against the parts below unless the person's overlap check is on; read the answer, then `overlap.check`.
+- Repeating a unit many times is better done by packing it into a submodel (`sub-skills/submodels/SUB-SKILL.md`) than by pasting copies, because a change then shows in every use.
+- From outside the window `cut` and `paste` wait for the person's answer there; `copy` never does.
diff --git a/.agents/skills/formblocks-driving/sub-skills/clips-and-hinges/SUB-SKILL.md b/.agents/skills/formblocks-driving/sub-skills/clips-and-hinges/SUB-SKILL.md
index a54221b..0fce61c 100644
--- a/.agents/skills/formblocks-driving/sub-skills/clips-and-hinges/SUB-SKILL.md
+++ b/.agents/skills/formblocks-driving/sub-skills/clips-and-hinges/SUB-SKILL.md
@@ -34,6 +34,10 @@ The clip's centre is put on the bar's line, and it slides along the bar in grid
A floating bar is put exactly with `part.set_transform`, because `part.place` rounds an unseated part to the grid (the first line answered position `[4, -76, 4]` and `seated` false). With `on`, the clip took the first free stretch of the bar, its centre at y = -70. With a position, a clip whose centre was at y = -41 seated at -50, the nearest place at the Stud step. The clip of `4085c` is at `[0, 4, -20]` in the part's own axes (`part.connectors part=4085c`), so its origin ends up 4 above the clip's centre and 20 behind the bar's line. Always read `seated`, `joined` and `marks` in the answer.
+## Plates that carry a clip, handle or hinge finger
+
+From 0.6.0 such a plate seats on studs from above: `part.fit` of `4085c` and of `2540` over a `3001` at `[3, -12, 2]` answered `seated` true at `[10, -8, -10]` and `[0, -8, -10]`, each joined to the brick's studs. A bar's `ref` (read it with `part.connectors part=2540`: `[0, 0, 1]`, the side its own plate is on) and a clip's `ref` (`[0, 0, -1]` for `4085c`) now decide the turn: a clip mates only with its body turned away from the bar's part, and snapping never turns it, so turn the clip first. The second rule is read from the specification; a clip held near a bar high in the air did not seat in either turn when tried, so treat it as not shown working here and check `seated`.
+
## Seating hinge halves
Snapping never turns a part. Turn the half first so its pivot line runs the way its partner's does, then place it near: it moves so the two lines meet.
@@ -63,4 +67,4 @@ Two halves joined by a seated hinge answered `count` 0. A clip seated on a bar,
## Not found, not built
-A hinge or clip drawn without the library's own pieces is found only where the engine's list of corrections names it (the 1 x 2 hinge brick, the swivel plates, the 1 x 1 tile with a clip); other parts do not snap, so place them by position and say so. Pins, axles, ball joints, a bar into a hole, hinge turning limits, click positions and flexible parts are not built: do not promise them.
+A hinge or clip drawn without the library's own pieces is found only where the engine's list of corrections names it (the 1 x 2 hinge brick, the swivel plates, the 1 x 1 tile with a clip); other parts do not snap, so place them by position and say so. Pins and axles are in their own sub-skill (`sub-skills/pins-and-axles/SUB-SKILL.md`). Ball joints, a bar into a hole, hinge turning limits, click positions and flexible parts are not built: do not promise them.
diff --git a/.agents/skills/formblocks-driving/sub-skills/colours/SUB-SKILL.md b/.agents/skills/formblocks-driving/sub-skills/colours/SUB-SKILL.md
index ec4ccbb..48b6f50 100644
--- a/.agents/skills/formblocks-driving/sub-skills/colours/SUB-SKILL.md
+++ b/.agents/skills/formblocks-driving/sub-skills/colours/SUB-SKILL.md
@@ -45,6 +45,7 @@ Read the table again when in doubt; a library update can add colours, and the pe
- Recolouring a use of a submodel in colour 16 passes the new colour to the parts inside that are in 16; parts with their own colour keep it.
- `select.by_colour` selects every visible placement in a colour, then `part.recolour` without `ids` acts on that selection.
- `colours.used` (read) lists the colours the model uses, most used first, each with `code`, `name`, `value`, `count` and `known` (false for a code the library does not define): the quickest way to check a build's colours.
+- `colours.favourite` (view) with `colour` stars a colour in the person's palette (Starred); `on` true or false sets it, and left out it turns the star the other way. It answered `{colour: 4, on: true, favourite_colours: [4]}` and, run again, `on` false and an empty list. `colours.list` rows carry `favourite`, true for a starred colour. It is the person's setting and changes no part.
- `colours.current` (view) chooses the colour the person's next part from the palette gets. It is the person's setting and recolours nothing; an agent passes `colour` on each `part.place` instead and leaves it alone.
## Choosing colours for a build
diff --git a/.agents/skills/formblocks-driving/sub-skills/pins-and-axles/SUB-SKILL.md b/.agents/skills/formblocks-driving/sub-skills/pins-and-axles/SUB-SKILL.md
new file mode 100644
index 0000000..f201610
--- /dev/null
+++ b/.agents/skills/formblocks-driving/sub-skills/pins-and-axles/SUB-SKILL.md
@@ -0,0 +1,64 @@
+---
+name: pins-and-axles
+description: Seats pins and axles in beams, bushes and bricks with a hole in FormBlocks with part.fit, part.place, part.connectors and part.rotate about the pin. Use when asked to build with beams with holes, pins, friction pins, axles, bushes, or a brick with a hole, to join two beams with a pin, to put an axle through a beam, to turn a beam on its pin, or when a pin or axle will not seat or reads as a different kind than expected.
+---
+
+# Pins and axles
+
+Added in 0.6.0. The engine finds pins, axles and the holes they go into from a part's own shape, and snaps them with the same rule as studs and clips: `part.place`, `part.fit` and the window's drags all use it. Read what a part has with `part.connectors` (read; pass `kind` to list one kind).
+
+## The kinds
+
+| Kind | What it is | Pairs with |
+| --- | --- | --- |
+| `pin` | A round shaft that turns freely in a hole, 20 LDU long for a full pin, 10 for a half pin. | `pin_hole` |
+| `pin_friction` | The same shaft with friction ribs. The engine treats it as a pin; it does not hold an angle. | `pin_hole` |
+| `pin_hole` | A round bore, 20 deep in a beam. Takes a pin from either face, or an axle. | `pin`, `pin_friction`, `axle` |
+| `axle` | A cross-shaped shaft, 80 LDU for an Axle 4. | `axle_hole`, `pin_hole` |
+| `axle_hole` | A cross-shaped bore, as in a bush. | `axle` |
+
+A pin does not go into an axle hole, and neither pins nor axles go into studs or anti-studs. A pin hole takes an axle and lets it turn. Parts whose pins or holes are drawn without the library's own pieces are not found: place those by position and say so.
+
+## Joining two beams with a pin
+
+A pin joined to a beam is seated by its end. Turn the pin first, since snapping never turns a part: `3673` Technic Pin 1/2 has a pin at each end, and with the matrix `0 1 0 / -1 0 0 / 0 0 1` its first end points down.
+
+```bash
+./formblocks cli run part.place part=32524 colour=7 'position=[0,0,0]'
+./formblocks cli run part.set_transform id=p1 'position=[0,0,0]'
+./formblocks cli run part.place part=3673 colour=4 'position=[1,-13,2]' 'rotation=[0,1,0,-1,0,0,0,0,1]'
+./formblocks cli run part.place part=32524 colour=7 'position=[2,-24,-41]'
+```
+
+Run here: the pin answered `seated` true at `[0, -10, 0]` with one joined pair and a mark at `[0, 10, 0]`, and the second beam seated at `[0, -20, -40]`, joined to the pin. The first line rounded the beam to `[9, -2, 9]` (an unseated part goes to the grid), hence the `part.set_transform`. `overlap.check` answered `count` 0 and `nested_count` 0: a pin fitted in a hole is joined, not an overlap.
+
+## Turning a beam on its pin
+
+`part.pivot` on the second beam answers kind `hinge`, about `[0, -20, 0]` along the pin; give both to `part.rotate`.
+
+```bash
+./formblocks cli run part.pivot 'ids=["p3"]'
+./formblocks cli run part.rotate 'ids=["p3"]' 'axis_vector=[0,1,0]' 'about=[0,-20,0]' angle=45
+```
+
+The beam turned 45 degrees to `[-28.284, -20, -28.284]` and `overlap.check` still answered `count` 0. A beam turns all the way round on a pin; turning limits are not built.
+
+## An axle through a beam
+
+An axle is seated on a hole's line and slides along it in grid steps from its middle.
+
+```bash
+./formblocks cli run part.fit part=3705 'position=[1,-7,2]' 'rotation=[0,1,0,-1,0,0,0,0,1]'
+```
+
+Run here against the same lone beam: `3705` Axle 4, turned upright, answered `seated` true at `[0, 0, 0]` (the beam's middle hole), mark at `[0, -40, 0]`. Unturned, the same call answered `seated` false: the axle must run along the hole. A bush turned to take it was fitted at `[1, -48, 2]` and answered false in this run, with no axle there; seating a bush on an axle is described in the specification (`spec/CONNECTIONS.md`, example 11) and not run here.
+
+## Reading and failures
+
+- `part.connectors part=32524` lists seven `pin_hole` entries, each `length` 20.
+- `part.connectors part=3705` lists one `axle`, `length` 80.
+- When a pin or axle does not seat, check the turn first (axis along the hole), then the distance (within the snap reach of the hole), then that the hole is not already taken.
+
+## Not built
+
+Ball joints and sockets, gears meshing, flexible parts, other scales' pins (the Scala pin), turning limits, friction as a held angle, and click positions on axles. Do not promise them.
diff --git a/.agents/skills/formblocks-driving/sub-skills/placing-and-snapping/SUB-SKILL.md b/.agents/skills/formblocks-driving/sub-skills/placing-and-snapping/SUB-SKILL.md
index 43eb734..908bae0 100644
--- a/.agents/skills/formblocks-driving/sub-skills/placing-and-snapping/SUB-SKILL.md
+++ b/.agents/skills/formblocks-driving/sub-skills/placing-and-snapping/SUB-SKILL.md
@@ -12,7 +12,7 @@ Read `references/coordinates-and-units.md` first if positions in LDU with -Y up
- A stud is the round knob on top of a part, 4 LDU high, on a 20 LDU grid.
- An anti-stud is a place on a part's underside that takes one stud: the gaps between the walls and tubes of a brick, or the inside of a tube.
- A part is seated when its anti-studs sit on another part's studs (or its studs in another part's anti-studs). Seating is how real bricks hold together, so a model built of seated parts is one that could be built.
-- FormBlocks finds these connectors from each part's own geometry; `part.connectors` lists them for any part. Only ordinary studs and anti-studs exist in this version: pins, axles, clips and hinges do not seat.
+- FormBlocks finds these connectors from each part's own geometry; `part.connectors` lists them for any part. Studs and anti-studs are the ordinary joins; clips on bars and hinge halves seat too (`sub-skills/clips-and-hinges/SUB-SKILL.md`). Pins and axles seat in holes (`sub-skills/pins-and-axles/SUB-SKILL.md`); ball joints do not seat yet.
## The ground
@@ -41,7 +41,7 @@ With snapping off (`snap: false`), the part goes exactly to the position, seated
Snapping never turns a part. To seat crosswise, give the turned `rotation`.
-Snapping, the grid step and the overlap check are the person's settings: `snap.set` (`on`), `grid.step` (`stud`, `plate` or `fine`) and `overlap.set` (`on`) change them for every later placement, in the window too. Pass `snap` on one call instead, and change a setting only when the person asks.
+Snapping, the grid step and the overlap check are the person's settings: `snap.set` (`on`), `grid.step` (`stud`, `plate` or `fine`) and `overlap.set` (`on`) change them for every later placement, in the window too. `snap.toggle`, `overlap.toggle` and `grid.next` flip or step the same settings from the engine's own state, which is what the window's keys use, so two quick presses end where they began; prefer the `set` forms, which say the end state. Pass `snap` on one call instead, and change a setting only when the person asks.
A fourth way to say where is a pointer ray, as the window drops the ghost: `part.place_at_ray`, in the scene's axes. It also rests a part on what lies under its whole footprint, so a plate dropped over an open gap lies across the parts either side. `sub-skills/moving-parts/SUB-SKILL.md` covers it.
diff --git a/.agents/skills/formblocks-driving/sub-skills/selection/SUB-SKILL.md b/.agents/skills/formblocks-driving/sub-skills/selection/SUB-SKILL.md
index 2449d58..2872006 100644
--- a/.agents/skills/formblocks-driving/sub-skills/selection/SUB-SKILL.md
+++ b/.agents/skills/formblocks-driving/sub-skills/selection/SUB-SKILL.md
@@ -22,6 +22,10 @@ Selection commands are `view` commands: they change what is shown, never the mod
| `select.invert` | none | Every visible placement that was not selected, letting go of the rest. |
| `select.by_colour` | `colour` | Every visible placement in that colour, or in the colours of the selection when left out. |
| `select.by_part` | `part` | Every visible placement of that part, or of the parts of the selection when left out. A printed part counts as a different part. |
+| `select.by_part_colour` | `ids` | Every visible placement that matches one of the given placements, or of the selection, in both its part and its colour. |
+| `select.attached` | `ids` | The given placements, or the selection, and every visible placement joined to them through seated connectors, however far the chain goes; a use of a submodel joins nothing. |
+
+`select.by_colour`, `select.by_part`, `select.by_part_colour` and `select.attached` also take `add` (true): the matches are added to the selection instead of replacing it. In a model of two stacked red and blue 2 x 4 bricks, a red 2 x 2 plate on its own and a red 2 x 4 brick elsewhere, `select.attached` for the lower brick answered both stacked bricks and nothing else, and `select.by_colour` for red answered the three red parts.
## Rules
@@ -45,6 +49,7 @@ So you can follow what they tell you (`spec/SPEC.md` 6.1):
- A click selects one part; a click on empty space or the ground clears the selection. Shift+click adds a part; Ctrl+click (Cmd on macOS) adds it or takes it away.
- A drag that starts on empty space draws a selection box. Left to right selects the parts wholly inside it, right to left every part it touches. Shift with the box adds; Ctrl adds the parts not yet selected or, when all are, takes them away. Esc while drawing drops the box.
- A drag that starts on a part moves it, or the selection it belongs to (`sub-skills/moving-parts/SUB-SKILL.md`).
+- Q goes through the pick modes a click uses (one part, same colour, same part, same part and colour, attached), and the Select menu has the same four kinds; each reaches the engine as the matching `select.*` command.
- Ctrl+A selects all, Ctrl+I inverts, Esc clears. Rows of the Model, Steps and Parts tabs select their parts too.
The box needs the view, so it has no command: an agent selects by ids or by kind. Every selection the person makes reaches the engine as `select.*` commands, so `select.get` always answers what the window shows.
diff --git a/.agents/skills/formblocks-driving/sub-skills/steps/SUB-SKILL.md b/.agents/skills/formblocks-driving/sub-skills/steps/SUB-SKILL.md
index 8821ae3..6ee30e7 100644
--- a/.agents/skills/formblocks-driving/sub-skills/steps/SUB-SKILL.md
+++ b/.agents/skills/formblocks-driving/sub-skills/steps/SUB-SKILL.md
@@ -15,6 +15,8 @@ Each submodel has its own building steps, numbered from 1. Every placement is in
| `step.goto` | view | `index` or `to` | Shows step `index` of the submodel being edited, or the `first`, `previous`, `next` or `last` step. New parts go into the step shown. Walking a model step by step is `sub-skills/step-walking/SUB-SKILL.md`. |
| `step.break_after` | change | `id` | Starts a new step after placement `id`, moving the placements after it in its step into the new step. With no `id`, adds an empty step after the step shown and shows it. |
| `step.move_parts` | change | `ids`, `step` | Moves placements into another step of their submodel; one past the last starts a new step at the end. |
+| `step.move_to_new` | change | `ids` | Puts the placements into a new step right after the step shown, and shows it. With the step shown being 2 of 3, the placement went into a new step 3 and the old step 3 became 4. |
+| `step.reorder` | change | `step`, `to`, `submodel` | Moves a whole step, with its parts, to another place in the order; the steps between close up and are renumbered. With three steps of one brick each, `step=3 to=1` answered the old third step first. A `to` outside the steps ("to must be from 1 to 3 in untitled.ldr.") or equal to `step` ("step 1 is already number 1; nothing moved.") is refused. |
| `step.rename` | change | `step`, `name`, `submodel` | Names a step; an empty name clears it. |
| `step.delete` | change | `step`, `submodel` | Deletes a step; its placements move to the start of the next step, or to the end of the step before when it was the last. A submodel keeps at least one step. |
diff --git a/.agents/skills/formblocks-harness/SKILL.md b/.agents/skills/formblocks-harness/SKILL.md
index a0cc957..427d375 100644
--- a/.agents/skills/formblocks-harness/SKILL.md
+++ b/.agents/skills/formblocks-harness/SKILL.md
@@ -4,7 +4,7 @@ description: "Use when asked to install, boot, verify, debug, extend or release
license: Apache-2.0
metadata:
product: FormBlocks
- pack-version: "0.5.0"
+ pack-version: "0.6.0"
audience: developer agent
---
diff --git a/.agents/skills/formblocks-harness/sub-skills/add-connector-kind/SUB-SKILL.md b/.agents/skills/formblocks-harness/sub-skills/add-connector-kind/SUB-SKILL.md
index 1559257..e046f9a 100644
--- a/.agents/skills/formblocks-harness/sub-skills/add-connector-kind/SUB-SKILL.md
+++ b/.agents/skills/formblocks-harness/sub-skills/add-connector-kind/SUB-SKILL.md
@@ -1,6 +1,6 @@
---
name: add-connector-kind
-description: Adds a connector kind to FormBlocks' connection model as a module that registers itself in backend/app/connect/kinds/, with its data beside it as JSON. Use when adding a joint beyond studs, anti-studs, clips, bars and the hinge families, such as pins or axles, when correcting the primitive list of an existing kind, or when a part's connectors come out wrong.
+description: Adds a connector kind to FormBlocks' connection model as a module that registers itself in backend/app/connect/kinds/, with its data beside it as JSON. Use when adding a joint beyond studs, anti-studs, clips, bars, the hinge families, pins and axles, such as ball joints or gears, when correcting the primitive list of an existing kind, or when a part's connectors come out wrong.
---
# Add a connector kind
@@ -16,7 +16,7 @@ Load `sub-skills/laws-and-logs/SUB-SKILL.md` and `sub-skills/clean-room-and-spec
## Where the module lives
-- `backend/app/connect/kinds/[kind].py`, one module per kind or per family of kinds. `kinds.load()` imports every module in the package whose name does not start with `_`, in name order, so no list is edited anywhere.
+- `backend/app/connect/kinds/[kind].py`, one module per kind or per family of kinds (`pin.py` holds three pin kinds, `axle.py` two, and `_shaft.py` is the measuring they share). `kinds.load()` imports every module in the package whose name does not start with `_`, in name order, so no list is edited anywhere.
- The module's data (primitive file names, tolerances) sits beside it as `[kind].json` and is read when the module loads, so a list can be corrected without touching code. A data file that cannot be read stops the engine with a sentence naming the file.
- At the end of the module, one call per kind: `PIN = register(PinKind())`.
@@ -42,6 +42,10 @@ A subclass of `Kind` from `backend/app/connect/kinds/__init__.py`:
`kinds/clip.py` (clip and bar) and `kinds/hinge.py` (the five hinge families, three read from primitives and two from overrides only) are the worked examples; each has its numbers in `clip.json` or `hinge.json`. `mates_with` is declared once per kind and the registry makes it symmetric, so a half pairs only with the other half of its own family.
+`kinds/pin.py` (`pin`, `pin_friction`, `pin_hole`) and `kinds/axle.py` (`axle`, `axle_hole`), with `_shaft.py` for what they share, are the worked examples of a kind built in two passes. No primitive draws a whole hole, so `claims` and `from_reference` make one piece per open face (a face point and the inward direction), and `settle` joins the pieces once the walk is over: two faces that look at each other on one line, nearest first and at most `max_depth` apart, become one hole; a face left alone has its bore probed for its depth. A hole is a point with a depth: its `position` is the middle of the bore, its `axis` runs along it, its `length` is the depth from face to face, and the mate puts a pin's collar at the hole's near face, half the depth from `position` (`spec/CONNECTIONS.md`, "The mate of a pin in a hole"). A pin or an axle is a segment (`spans`), so a long one can take two holes.
+
+`version` is read from the top of the kind's JSON file (`"version"` in `pin.json`, `axle.json`, `clip.json`), not written in the module: raise it there in the same commit whenever the kind's rule or its data changes, and every cached part is derived again.
+
Connectors already carry `ref` (for kinds whose turn about the axis matters) and `length` (for kinds that slide), so the connector shape does not change.
## Overrides
diff --git a/.claude/skills/formblocks-driving/SKILL.md b/.claude/skills/formblocks-driving/SKILL.md
index 906173e..41713d7 100644
--- a/.claude/skills/formblocks-driving/SKILL.md
+++ b/.claude/skills/formblocks-driving/SKILL.md
@@ -1,10 +1,10 @@
---
name: formblocks-driving
-description: "Use when asked to build, stack, change, check, picture or save a brick model in FormBlocks through its MCP tools or ./formblocks cli: a wall, a tower, a house, a table, any LDraw model. Finds parts and colours in the LDraw parts library, places and seats bricks, clips and hinge halves on placements or the ground, builds walls in overlapping courses with plates, tiles and slopes, moves, turns, duplicates and recolours parts, uses the selection and submodels, splits a model into steps and walks them, counts parts and saves the parts list as CSV, saves PNG pictures and reads them back to check a build, checks overlaps, and opens, saves and exports .fblk, .ldr and .mpd files. Covers Claude Code, Codex, Cursor and Antigravity in the agent dock or outside it, and the person's approval, which an agent never gives itself. Includes worked examples, coordinates, error codes and scripts. Not for changing FormBlocks' source code or installing it (formblocks-harness)."
+description: "Use when asked to build, stack, change, check, picture or save a brick model in FormBlocks through its MCP tools or ./formblocks cli: a wall, a tower, a house, a table, any LDraw model. Finds parts and colours in the LDraw parts library, places and seats bricks, clips and hinge halves on placements or the ground, builds walls in overlapping courses with plates, tiles and slopes, moves, turns, duplicates, copies, pastes and recolours parts, uses the selection and submodels, splits a model into steps and walks them, counts parts and saves the parts list as CSV, saves PNG pictures and reads them back to check a build, checks overlaps, and opens, saves and exports .fblk, .ldr and .mpd files. Covers Claude Code, Codex, Cursor and Antigravity in the agent dock or outside it, and the person's approval, which an agent never gives itself. Includes worked examples, coordinates, error codes and scripts. Not for changing FormBlocks' source code or installing it (formblocks-harness)."
license: Apache-2.0
metadata:
product: FormBlocks
- pack-version: "0.5.0"
+ pack-version: "0.6.0"
audience: operating agent
---
@@ -23,6 +23,8 @@ FormBlocks keeps one open model in its engine: submodels holding placements of L
| Clips on bars, hinge halves, hinge plates and bricks, swivel plates, sliding a clip, folding a hinge, part.connectors kinds | `sub-skills/clips-and-hinges/SUB-SKILL.md` |
| Planning a build, walls in overlapping courses, corners, openings, plates and tiles, roofs of slopes | `sub-skills/building-in-order/SUB-SKILL.md` |
| Moving, turning, duplicating, recolouring, hiding, showing and deleting placements, undo and redo | `sub-skills/changing-parts/SUB-SKILL.md` |
+| Beams with holes, pins, friction pins, axles, bushes, a brick with a hole, joining beams, turning a beam on a pin | `sub-skills/pins-and-axles/SUB-SKILL.md` |
+| Copying, cutting and pasting parts as LDraw lines, repeating a group at an offset, clipboard.copy, clipboard.cut, clipboard.paste | `sub-skills/clipboard/SUB-SKILL.md` |
| Turning parts by any angle, about a point, an axis or a hinge's axis, part.pivot, the angle step, a turn lifted or refused | `sub-skills/turning-parts/SUB-SKILL.md` |
| Moving or copying parts along a pointer ray as the window drags them, part.pick, the scene's axes, resting across a gap, what the person's drags and Ctrl+D do | `sub-skills/moving-parts/SUB-SKILL.md` |
| Reading and setting the selection, selecting by colour or part, showing the person which parts | `sub-skills/selection/SUB-SKILL.md` |
diff --git a/.claude/skills/formblocks-driving/references/command-catalogue.md b/.claude/skills/formblocks-driving/references/command-catalogue.md
index 9c9f875..7c1baaf 100644
--- a/.claude/skills/formblocks-driving/references/command-catalogue.md
+++ b/.claude/skills/formblocks-driving/references/command-catalogue.md
@@ -4,8 +4,8 @@ Written by `./formblocks agents sync` from the engine's command catalogue; never
## Contents
-- MCP tools: the 72 tools an agent sees, each with whether it only reads.
-- Commands: the 66 catalogue commands with their titles, parameters and summaries, in name order.
+- MCP tools: the 85 tools an agent sees, each with whether it only reads.
+- Commands: the 79 catalogue commands with their titles, parameters and summaries, in name order.
## MCP tools
@@ -17,10 +17,16 @@ Written by `./formblocks agents sync` from the engine's command catalogue; never
| `formblocks_redo` | no | Redo changes that formblocks_undo took back, one step each. A new change after an undo empties what can be redone. Returns {revision, labels, label}. |
| `formblocks_status` | yes | Read what this FormBlocks is: its version, the model's revision, placement count, file and unsaved mark, how many commands there are, its data folder, whether the window's engine is running, and the person's standing choice for outside agents (ask, allowed or blocked). Call it first. |
| `formblocks_undo` | no | Undo the last changes, one step per command. Returns {revision, labels, label}: the new revision and the titles of the commands taken back, newest first. Nothing to undo answers an empty labels list. |
+| `cmd_angle_next` | yes | Go to the next angle step after the engine's own: 90, 45, 22.5, 15, 5, 1 degrees, then 90 again. Kept as the person's setting. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
| `cmd_angle_step` | yes | Choose the angle step a turn with the pointer moves in and Alt with R, T or Y turns by: 90, 45, 22.5, 15, 5 or 1 degrees. Kept as the person's setting. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
+| `cmd_clipboard_copy` | yes | Write placements as LDraw part lines (type 1, colour, position, rotation, file name), the text the window puts on the system clipboard; the engine keeps it too, for clipboard.paste without text. Only reads. |
+| `cmd_clipboard_cut` | no | Copy placements as LDraw part lines, as clipboard.copy does, and remove them from the model. One undo step. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
+| `cmd_clipboard_paste` | no | Add the parts that LDraw part lines name, keeping their colours and their places relative to one another, into the step shown of the submodel being edited; they become the selection. With a pointer ray in the window's scene axes they go where the ray takes the lowest of them, seated, resting or refused exactly as a drag of copies; without one they go where the lines put them, moved by delta. One undo step. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
| `cmd_colours_current` | yes | Choose the colour the next placed part gets, and put it at the front of the recent colours. Kept as the person's setting; it recolours nothing. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
+| `cmd_colours_favourite` | yes | Star or unstar a colour: a starred colour is listed among the favourite colours, newest first. Left out, on turns the star the other way. Kept as the person's setting; it changes no model. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
| `cmd_colours_list` | yes | List the library's colours with code, name, value, edge and finish, or the swatches of one group, hue family or name words. Only reads. |
| `cmd_colours_used` | yes | List the colours used in the open model, most used first: each colour's number, name, value, how many parts of the whole model are in it, and whether the library defines it. Only reads. |
+| `cmd_grid_next` | yes | Go to the next grid step after the engine's own: stud, plate, fine, then stud again. Kept as the person's setting. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
| `cmd_grid_step` | yes | Choose the grid step: stud (20 LDU across, 8 up), plate (10 across, 8 up) or fine (1 and 1). Kept as the person's setting. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
| `cmd_library_status` | yes | Read whether a parts library is in use, where it was found, its update, whether its index is ready, the fetch in progress if any, and the consent and attribution the library card shows. Reading never fetches; only the person can consent to a fetch. Only reads. |
| `cmd_model_info` | yes | Read the model's name, description (its title line), author, file, format and the library update it was saved with and the one in use; its counts (placements, parts through every use, different parts, colours, part and colour pairs, submodels, steps, missing parts, and overlapping pairs as overlap.check counts them); the parts the library lacks by number; its size in LDU, studs, bricks and millimetres; the licences model.set_info accepts; and its parts list unless table is false. Only reads. |
@@ -35,7 +41,9 @@ Written by `./formblocks agents sync` from the engine's command catalogue; never
| `cmd_model_tree` | yes | Read one submodel's steps and placements, each with its id, part, colour, position, rotation, step and hidden mark, and the submodels with their uses. Only reads. |
| `cmd_overlap_check` | yes | List each pair of overlapping placements, for the given placements or the whole model: two parts whose real shapes cut more than 1 LDU into each other, with the depth in LDU and the shared volume in cubic LDU. Parts joined through seated connectors never count. Nested pairs, one part sitting in another's hollow by design, are counted apart in nested_count and listed under nested when asked. Only reads. |
| `cmd_overlap_nested` | yes | Choose what the overlap check reports: false reports only real overlaps (the proposed default), true reports nested pairs too, parts that sit in another's hollow by design, such as a rim in its tyre or a pin in its hole. Nested pairs never block placing or moving either way. Kept as the person's setting. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
+| `cmd_overlap_nested_toggle` | yes | Turn the reporting of nested pairs off when it is on and on when it is off, deciding from the engine's own setting. Kept as the person's setting. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
| `cmd_overlap_set` | yes | Turn the overlap check on or off: with it on, placing and moving never put a part where its real shape would cut more than 1 LDU into another's. Kept as the person's setting. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
+| `cmd_overlap_toggle` | yes | Turn the overlap check off when it is on and on when it is off, deciding from the engine's own setting, so two quick presses always end where they began. Kept as the person's setting. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
| `cmd_part_connectors` | yes | List a library part's connectors as the connection model derives them: kind, position, axis, ref, length, index and where each came from, with the counts, the body box and the footprint; kind keeps only connectors of one kind. Only reads. |
| `cmd_part_delete` | no | Remove placements from the model; deleting the last use of a submodel keeps the submodel. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
| `cmd_part_duplicate` | no | Copy placements, keeping colours and relative places, offset by delta; the copies go into the step shown and become the selection. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
@@ -43,7 +51,7 @@ Written by `./formblocks agents sync` from the engine's command catalogue; never
| `cmd_part_fit` | yes | Answer where a part would go and which connectors it would join, from a position, a placement to seat on, or a pointer ray, with snapping, the grid step and the overlap check as set; changes nothing. Position and rotation are in LDraw axes (-Y up); a pointer ray is in the window's scene axes (+Y up), as for every command that takes one. Only reads. |
| `cmd_part_hide` | no | Hide placements: they stay in the model but are not drawn or picked, and the project file remembers it. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
| `cmd_part_hide_others` | no | Hide every placement of the submodel being edited except the given ones or the selection, to work on one area alone. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
-| `cmd_part_move` | no | Move placements by an offset in LDU, exactly, with no snapping. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
+| `cmd_part_move` | no | Move placements by an offset in LDU, exactly, with no snapping; with the overlap check on, a move into a part that does not move is refused. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
| `cmd_part_move_at_ray` | no | Put down a dragged selection where a pointer ray in the window's scene axes takes the grabbed placement, seated, on the grid or refused exactly as the drag preview answers, resting on what lies under its footprint when the place under the pointer would cut into another part; the others keep their places relative to it. Give held as the drag preview answered it so the part lands as previewed. One undo step. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
| `cmd_part_pick` | yes | Name the placement of the submodel being edited that a pointer ray in the window's scene axes meets first on its real triangles, with the point and the face's normal, or the ground; hidden parts are passed through. Only reads. |
| `cmd_part_pivot` | yes | Say what placements turn about when the pivot dial turns them: the centre of the box around their shapes with the X, Y and Z axes, or, for one part joined by a hinge, the hinge's point and axis alone; with a pointer ray, the point where it meets a part of the submodel being edited (or the connector within 8 LDU of it), with X, Y and Z, and as without a ray when it meets none. Each point and axis in LDraw's axes and in the window's scene axes, with how far the box reaches from the point. Only reads. |
@@ -51,7 +59,7 @@ Written by `./formblocks agents sync` from the engine's command catalogue; never
| `cmd_part_place_at_ray` | no | Place a library part where a pointer ray in the window's scene axes puts it, seated, on the grid or refused exactly as the placement preview answers, resting on what lies under its whole footprint when the place under the pointer would cut into another part; it goes into the step shown of the submodel being edited and becomes the selection. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
| `cmd_part_recolour` | no | Give placements a colour; a use of a submodel in colour 16 passes it to its parts in colour 16. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
| `cmd_part_rotate` | no | Turn placements about an axis through a point: by whole quarter turns, or by an angle in degrees, about X, Y, Z or any direction in LDraw axes, about the centre of their box when no point is given. What turned is lifted straight up when it would end below the ground, and with the overlap check on a turn into a part that does not turn is refused. One undo step. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
-| `cmd_part_set_transform` | no | Put one placement at an exact position, rotation or both, as the details panel does. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
+| `cmd_part_set_transform` | no | Put one placement at an exact position, rotation or both, as the details panel does; with the overlap check on, a place inside another part is refused. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
| `cmd_part_show` | no | Show hidden placements again; every hidden placement in the model when no ids are given (Show all). Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
| `cmd_parts_list` | yes | Read the parts a model needs, one row per part and colour with its description, colour name, count and the placements of the submodel being edited that hold it; a submodel's parts counted once for each use unless submodels is row, a moved part counted under the number it moved to, parts missing from the library first and marked. With text true the answer also holds the list as tab separated text. Only reads. |
| `cmd_parts_list_save` | no | Write the parts list to a file as CSV in UTF-8 with a byte order mark and CR LF line ends: a header row, then one row per part and colour with LDraw part number, description, LDraw colour number, colour name and count; comma separated, or tab separated for a .tsv path or separator tab. A cell starting with =, +, - or @ is written after an apostrophe so a spreadsheet reads it as text. Opens, starts or writes a model file; not an undo step. An outside agent waits for the person to allow it in the window. |
@@ -61,20 +69,25 @@ Written by `./formblocks agents sync` from the engine's command catalogue; never
| `cmd_picture_steps` | no | Draw one PNG for every step of the submodel being edited, each showing the steps up to it, and write them into a folder as name-01.png, name-02.png and so on. Needs the FormBlocks window open. Opens, starts or writes a model file; not an undo step. An outside agent waits for the person to allow it in the window. |
| `cmd_select_add` | yes | Add placements to the selection. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
| `cmd_select_all` | yes | Select every visible placement of the submodel being edited. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
+| `cmd_select_attached` | yes | Select the given placements, or the selection, and every visible placement joined to them through seated connectors, however far the chain goes; a use of a submodel joins nothing. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
| `cmd_select_by_colour` | yes | Select every visible placement in a colour, or in the colours of the selection when no colour is given. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
| `cmd_select_by_part` | yes | Select every visible placement of a part, or of the parts of the selection when no part is given; a printed part is a different part. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
+| `cmd_select_by_part_colour` | yes | Select every visible placement that matches one of the given placements, or of the selection, in both its part and its colour; a printed part is a different part. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
| `cmd_select_clear` | yes | Clear the selection. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
| `cmd_select_get` | yes | Read the selection: the placements, how many, in how many colours, and the centre of their origins. Only reads. |
| `cmd_select_invert` | yes | Select every visible placement that was not selected and let go of the rest. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
| `cmd_select_remove` | yes | Let go of placements without touching the rest of the selection. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
| `cmd_select_set` | yes | Make the selection exactly these placements; an empty list clears it. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
| `cmd_snap_set` | yes | Turn snapping on or off: with it on, a part being placed or moved seats on free compatible connectors within reach; with it off, it moves in grid steps only. Kept as the person's setting. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
+| `cmd_snap_toggle` | yes | Turn snapping off when it is on and on when it is off, deciding from the engine's own setting, so two quick presses always end where they began. Kept as the person's setting. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
| `cmd_step_break_after` | no | Start a new step after a placement, moving the placements after it in its step into the new step; with no id, add an empty step after the step shown and show it. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
| `cmd_step_delete` | no | Delete a step; its placements move to the start of the next step, or to the end of the step before when it is the last. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
| `cmd_step_goto` | yes | Show a step of the submodel being edited, by number or as first, previous, next or last: every placement of steps 1 to it is drawn, later ones are hidden, and new parts go into it. Changes only the view (the selection, the step shown or the submodel being edited); no undo step. |
| `cmd_step_list` | yes | Read the steps of a submodel: each step's number, name and placement ids, and which step is shown. Only reads. |
| `cmd_step_move_parts` | no | Move placements of one submodel into another of its steps; one past the last step starts a new step at the end. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
+| `cmd_step_move_to_new` | no | Put placements of one submodel into a new step right after the step shown, and show it. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
| `cmd_step_rename` | no | Name a step, or clear its name with an empty name; the name is kept in the file as the step's first line. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
+| `cmd_step_reorder` | no | Move a step with everything in it to another place in its submodel's order; the steps between close up and are numbered again. The step shown stays the same step. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
| `cmd_submodel_create` | no | Pack placements of one submodel into a new submodel and put one use of it in their place. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
| `cmd_submodel_delete` | no | Delete a submodel that is not the main model; one that still has uses is kept unless with_uses is true, which deletes the uses too. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
| `cmd_submodel_dissolve` | no | Put a use's parts back into its parent at the same places, in the use's step; the submodel goes when its last use is unpacked. Changes the model; one undo step. An outside agent waits for the person to allow it in the window. |
@@ -88,10 +101,16 @@ Written by `./formblocks agents sync` from the engine's command catalogue; never
| Command | Title | Reads only | Parameters | What it does |
| --- | --- | --- | --- | --- |
+| `angle.next` | Next Angle Step | yes | none | Go to the next angle step after the engine's own: 90, 45, 22.5, 15, 5, 1 degrees, then 90 again. Kept as the person's setting. |
| `angle.step` | Angle Step | yes | `step` (number) | Choose the angle step a turn with the pointer moves in and Alt with R, T or Y turns by: 90, 45, 22.5, 15, 5 or 1 degrees. Kept as the person's setting. |
+| `clipboard.copy` | Copy | yes | `ids` (array, optional) | Write placements as LDraw part lines (type 1, colour, position, rotation, file name), the text the window puts on the system clipboard; the engine keeps it too, for clipboard.paste without text. |
+| `clipboard.cut` | Cut | no | `ids` (array, optional) | Copy placements as LDraw part lines, as clipboard.copy does, and remove them from the model. One undo step. |
+| `clipboard.paste` | Paste | no | `text` (string, optional), `origin` (array, optional), `direction` (array, optional), `rotation` (array, optional), `held` (integer, optional), `snap` (boolean, optional), `delta` (array, optional) | Add the parts that LDraw part lines name, keeping their colours and their places relative to one another, into the step shown of the submodel being edited; they become the selection. With a pointer ray in the window's scene axes they go where the ray takes the lowest of them, seated, resting or refused exactly as a drag of copies; without one they go where the lines put them, moved by delta. One undo step. |
| `colours.current` | Current Colour | yes | `colour` (integer) | Choose the colour the next placed part gets, and put it at the front of the recent colours. Kept as the person's setting; it recolours nothing. |
+| `colours.favourite` | Favourite Colour | yes | `colour` (integer), `on` (boolean, optional) | Star or unstar a colour: a starred colour is listed among the favourite colours, newest first. Left out, on turns the star the other way. Kept as the person's setting; it changes no model. |
| `colours.list` | Colours | yes | `text` (string, optional), `group` (string, optional), `hue` (string, optional) | List the library's colours with code, name, value, edge and finish, or the swatches of one group, hue family or name words. |
| `colours.used` | Colours Used | yes | none | List the colours used in the open model, most used first: each colour's number, name, value, how many parts of the whole model are in it, and whether the library defines it. |
+| `grid.next` | Next Grid Step | yes | none | Go to the next grid step after the engine's own: stud, plate, fine, then stud again. Kept as the person's setting. |
| `grid.step` | Grid Step | yes | `step` (string) | Choose the grid step: stud (20 LDU across, 8 up), plate (10 across, 8 up) or fine (1 and 1). Kept as the person's setting. |
| `library.status` | Library Status | yes | none | Read whether a parts library is in use, where it was found, its update, whether its index is ready, the fetch in progress if any, and the consent and attribution the library card shows. Reading never fetches; only the person can consent to a fetch. |
| `model.info` | Model Information | yes | `table` (boolean, optional) | Read the model's name, description (its title line), author, file, format and the library update it was saved with and the one in use; its counts (placements, parts through every use, different parts, colours, part and colour pairs, submodels, steps, missing parts, and overlapping pairs as overlap.check counts them); the parts the library lacks by number; its size in LDU, studs, bricks and millimetres; the licences model.set_info accepts; and its parts list unless table is false. |
@@ -106,7 +125,9 @@ Written by `./formblocks agents sync` from the engine's command catalogue; never
| `model.tree` | Model Tree | yes | `submodel` (string, optional) | Read one submodel's steps and placements, each with its id, part, colour, position, rotation, step and hidden mark, and the submodels with their uses. |
| `overlap.check` | Check Overlaps | yes | `ids` (array, optional), `nested` (boolean, optional) | List each pair of overlapping placements, for the given placements or the whole model: two parts whose real shapes cut more than 1 LDU into each other, with the depth in LDU and the shared volume in cubic LDU. Parts joined through seated connectors never count. Nested pairs, one part sitting in another's hollow by design, are counted apart in nested_count and listed under nested when asked. |
| `overlap.nested` | Nested Pairs | yes | `on` (boolean) | Choose what the overlap check reports: false reports only real overlaps (the proposed default), true reports nested pairs too, parts that sit in another's hollow by design, such as a rim in its tyre or a pin in its hole. Nested pairs never block placing or moving either way. Kept as the person's setting. |
+| `overlap.nested_toggle` | Nested Pairs On or Off | yes | none | Turn the reporting of nested pairs off when it is on and on when it is off, deciding from the engine's own setting. Kept as the person's setting. |
| `overlap.set` | Overlap Check | yes | `on` (boolean) | Turn the overlap check on or off: with it on, placing and moving never put a part where its real shape would cut more than 1 LDU into another's. Kept as the person's setting. |
+| `overlap.toggle` | Overlap Check On or Off | yes | none | Turn the overlap check off when it is on and on when it is off, deciding from the engine's own setting, so two quick presses always end where they began. Kept as the person's setting. |
| `part.connectors` | Part Connectors | yes | `part` (string), `kind` (string, optional) | List a library part's connectors as the connection model derives them: kind, position, axis, ref, length, index and where each came from, with the counts, the body box and the footprint; kind keeps only connectors of one kind. |
| `part.delete` | Delete | no | `ids` (array, optional) | Remove placements from the model; deleting the last use of a submodel keeps the submodel. |
| `part.duplicate` | Duplicate | no | `ids` (array, optional), `delta` (array, optional) | Copy placements, keeping colours and relative places, offset by delta; the copies go into the step shown and become the selection. |
@@ -114,7 +135,7 @@ Written by `./formblocks agents sync` from the engine's command catalogue; never
| `part.fit` | Fit Part | yes | `part` (string), `rotation` (array, optional), `position` (array, optional), `on` (string, optional), `origin` (array, optional), `direction` (array, optional), `ids` (array, optional), `submodel` (string, optional), `snap` (boolean, optional) | Answer where a part would go and which connectors it would join, from a position, a placement to seat on, or a pointer ray, with snapping, the grid step and the overlap check as set; changes nothing. Position and rotation are in LDraw axes (-Y up); a pointer ray is in the window's scene axes (+Y up), as for every command that takes one. |
| `part.hide` | Hide | no | `ids` (array, optional) | Hide placements: they stay in the model but are not drawn or picked, and the project file remembers it. |
| `part.hide_others` | Hide Others | no | `ids` (array, optional) | Hide every placement of the submodel being edited except the given ones or the selection, to work on one area alone. |
-| `part.move` | Move | no | `ids` (array, optional), `delta` (array) | Move placements by an offset in LDU, exactly, with no snapping. |
+| `part.move` | Move | no | `ids` (array, optional), `delta` (array) | Move placements by an offset in LDU, exactly, with no snapping; with the overlap check on, a move into a part that does not move is refused. |
| `part.move_at_ray` | Move Selection at Pointer | no | `grab` (string), `origin` (array), `direction` (array), `rotation` (array, optional), `held` (integer, optional), `ids` (array, optional), `snap` (boolean, optional) | Put down a dragged selection where a pointer ray in the window's scene axes takes the grabbed placement, seated, on the grid or refused exactly as the drag preview answers, resting on what lies under its footprint when the place under the pointer would cut into another part; the others keep their places relative to it. Give held as the drag preview answered it so the part lands as previewed. One undo step. |
| `part.pick` | Pick at Pointer | yes | `origin` (array), `direction` (array), `ground` (boolean, optional) | Name the placement of the submodel being edited that a pointer ray in the window's scene axes meets first on its real triangles, with the point and the face's normal, or the ground; hidden parts are passed through. |
| `part.pivot` | Pivot | yes | `ids` (array, optional), `origin` (array, optional), `direction` (array, optional) | Say what placements turn about when the pivot dial turns them: the centre of the box around their shapes with the X, Y and Z axes, or, for one part joined by a hinge, the hinge's point and axis alone; with a pointer ray, the point where it meets a part of the submodel being edited (or the connector within 8 LDU of it), with X, Y and Z, and as without a ray when it meets none. Each point and axis in LDraw's axes and in the window's scene axes, with how far the box reaches from the point. |
@@ -122,7 +143,7 @@ Written by `./formblocks agents sync` from the engine's command catalogue; never
| `part.place_at_ray` | Place Part at Pointer | no | `part` (string), `colour` (integer), `origin` (array), `direction` (array), `rotation` (array, optional), `held` (integer, optional), `step` (integer, optional), `snap` (boolean, optional) | Place a library part where a pointer ray in the window's scene axes puts it, seated, on the grid or refused exactly as the placement preview answers, resting on what lies under its whole footprint when the place under the pointer would cut into another part; it goes into the step shown of the submodel being edited and becomes the selection. |
| `part.recolour` | Recolour | no | `ids` (array, optional), `colour` (integer) | Give placements a colour; a use of a submodel in colour 16 passes it to its parts in colour 16. |
| `part.rotate` | Rotate | no | `ids` (array, optional), `axis` (string, optional), `quarter_turns` (integer, optional), `angle` (number, optional), `axis_vector` (array, optional), `about` (array, optional) | Turn placements about an axis through a point: by whole quarter turns, or by an angle in degrees, about X, Y, Z or any direction in LDraw axes, about the centre of their box when no point is given. What turned is lifted straight up when it would end below the ground, and with the overlap check on a turn into a part that does not turn is refused. One undo step. |
-| `part.set_transform` | Set Position and Rotation | no | `id` (string), `position` (array, optional), `rotation` (array, optional) | Put one placement at an exact position, rotation or both, as the details panel does. |
+| `part.set_transform` | Set Position and Rotation | no | `id` (string), `position` (array, optional), `rotation` (array, optional) | Put one placement at an exact position, rotation or both, as the details panel does; with the overlap check on, a place inside another part is refused. |
| `part.show` | Show | no | `ids` (array, optional) | Show hidden placements again; every hidden placement in the model when no ids are given (Show all). |
| `parts.list` | Parts List | yes | `scope` (string, optional), `group` (string, optional), `submodels` (string, optional), `text` (boolean, optional) | Read the parts a model needs, one row per part and colour with its description, colour name, count and the placements of the submodel being edited that hold it; a submodel's parts counted once for each use unless submodels is row, a moved part counted under the number it moved to, parts missing from the library first and marked. With text true the answer also holds the list as tab separated text. |
| `parts.list_save` | Save Parts List | no | `path` (string), `separator` (string, optional), `scope` (string, optional), `group` (string, optional), `submodels` (string, optional) | Write the parts list to a file as CSV in UTF-8 with a byte order mark and CR LF line ends: a header row, then one row per part and colour with LDraw part number, description, LDraw colour number, colour name and count; comma separated, or tab separated for a .tsv path or separator tab. A cell starting with =, +, - or @ is written after an apostrophe so a spreadsheet reads it as text. |
@@ -132,20 +153,25 @@ Written by `./formblocks agents sync` from the engine's command catalogue; never
| `picture.steps` | Save Step Pictures | no | `folder` (string), `name` (string, optional), `width` (integer, optional), `height` (integer, optional), `scale` (integer, optional), `background` (string, optional), `ground` (boolean, optional), `view` (string, optional), `fade` (boolean, optional) | Draw one PNG for every step of the submodel being edited, each showing the steps up to it, and write them into a folder as name-01.png, name-02.png and so on. Needs the FormBlocks window open. |
| `select.add` | Add to Selection | yes | `ids` (array) | Add placements to the selection. |
| `select.all` | Select All | yes | none | Select every visible placement of the submodel being edited. |
-| `select.by_colour` | Select Same Colour | yes | `colour` (integer, optional) | Select every visible placement in a colour, or in the colours of the selection when no colour is given. |
-| `select.by_part` | Select Same Part | yes | `part` (string, optional) | Select every visible placement of a part, or of the parts of the selection when no part is given; a printed part is a different part. |
+| `select.attached` | Select Attached | yes | `ids` (array, optional), `add` (boolean, optional) | Select the given placements, or the selection, and every visible placement joined to them through seated connectors, however far the chain goes; a use of a submodel joins nothing. |
+| `select.by_colour` | Select Same Colour | yes | `colour` (integer, optional), `add` (boolean, optional) | Select every visible placement in a colour, or in the colours of the selection when no colour is given. |
+| `select.by_part` | Select Same Part | yes | `part` (string, optional), `add` (boolean, optional) | Select every visible placement of a part, or of the parts of the selection when no part is given; a printed part is a different part. |
+| `select.by_part_colour` | Select Same Part and Colour | yes | `ids` (array, optional), `add` (boolean, optional) | Select every visible placement that matches one of the given placements, or of the selection, in both its part and its colour; a printed part is a different part. |
| `select.clear` | Select None | yes | none | Clear the selection. |
| `select.get` | Selection | yes | none | Read the selection: the placements, how many, in how many colours, and the centre of their origins. |
| `select.invert` | Invert Selection | yes | none | Select every visible placement that was not selected and let go of the rest. |
| `select.remove` | Remove from Selection | yes | `ids` (array) | Let go of placements without touching the rest of the selection. |
| `select.set` | Select | yes | `ids` (array) | Make the selection exactly these placements; an empty list clears it. |
| `snap.set` | Snapping | yes | `on` (boolean) | Turn snapping on or off: with it on, a part being placed or moved seats on free compatible connectors within reach; with it off, it moves in grid steps only. Kept as the person's setting. |
+| `snap.toggle` | Snapping On or Off | yes | none | Turn snapping off when it is on and on when it is off, deciding from the engine's own setting, so two quick presses always end where they began. Kept as the person's setting. |
| `step.break_after` | New Step | no | `id` (string, optional) | Start a new step after a placement, moving the placements after it in its step into the new step; with no id, add an empty step after the step shown and show it. |
| `step.delete` | Delete Step | no | `step` (integer), `submodel` (string, optional) | Delete a step; its placements move to the start of the next step, or to the end of the step before when it is the last. |
| `step.goto` | Show Step | yes | `index` (integer, optional), `to` (string, optional) | Show a step of the submodel being edited, by number or as first, previous, next or last: every placement of steps 1 to it is drawn, later ones are hidden, and new parts go into it. |
| `step.list` | Steps | yes | `submodel` (string, optional) | Read the steps of a submodel: each step's number, name and placement ids, and which step is shown. |
| `step.move_parts` | Move to Step | no | `ids` (array, optional), `step` (integer) | Move placements of one submodel into another of its steps; one past the last step starts a new step at the end. |
+| `step.move_to_new` | Move to New Step | no | `ids` (array, optional) | Put placements of one submodel into a new step right after the step shown, and show it. |
| `step.rename` | Rename Step | no | `step` (integer), `name` (string), `submodel` (string, optional) | Name a step, or clear its name with an empty name; the name is kept in the file as the step's first line. |
+| `step.reorder` | Move Step | no | `step` (integer), `to` (integer), `submodel` (string, optional) | Move a step with everything in it to another place in its submodel's order; the steps between close up and are numbered again. The step shown stays the same step. |
| `submodel.create` | Pack | no | `ids` (array, optional), `name` (string) | Pack placements of one submodel into a new submodel and put one use of it in their place. |
| `submodel.delete` | Delete Submodel | no | `name` (string), `with_uses` (boolean, optional) | Delete a submodel that is not the main model; one that still has uses is kept unless with_uses is true, which deletes the uses too. |
| `submodel.dissolve` | Unpack | no | `id` (string, optional) | Put a use's parts back into its parent at the same places, in the use's step; the submodel goes when its last use is unpacked. |
diff --git a/.claude/skills/formblocks-driving/sub-skills/clipboard/SUB-SKILL.md b/.claude/skills/formblocks-driving/sub-skills/clipboard/SUB-SKILL.md
new file mode 100644
index 0000000..eafa723
--- /dev/null
+++ b/.claude/skills/formblocks-driving/sub-skills/clipboard/SUB-SKILL.md
@@ -0,0 +1,38 @@
+---
+name: clipboard
+description: Copies, cuts and pastes parts in a FormBlocks model as LDraw part lines with clipboard.copy, clipboard.cut and clipboard.paste. Use when asked to repeat a group of parts somewhere else, move a built unit by a fixed offset, paste parts given as LDraw text, or take parts out of one place to put them down in another, and when a paste is refused or lands on top of the original.
+---
+
+# Clipboard
+
+The clipboard holds LDraw part lines: one line per placement, `1 colour x y z a b c d e f g h i part.dat`, in LDraw's axes with -Y up. It is the same text the window puts on the system clipboard with Ctrl+C, so parts copied here paste into other LDraw programs and the other way round. The engine keeps the last copy too, so a paste with no `text` uses it.
+
+## The three commands
+
+| Command | Kind | What it does |
+| --- | --- | --- |
+| `clipboard.copy` | read | Answers `{text, count}` for the placements in `ids` (the selection when left out). Changes nothing. |
+| `clipboard.cut` | change | The same answer, and removes the placements: one undo step. |
+| `clipboard.paste` | change | Adds the parts of the lines in `text` (or the engine's last copy) to the step shown of the submodel being edited, keeping colours and the places of the parts relative to each other, and selects them. |
+
+`paste` takes one placing rule:
+
+- `delta` `[x, y, z]`: the whole group moves by that offset in LDU. `delta [0, 0, 0]` puts the copies exactly on the originals, which is almost never what you want; with the overlap check on it is refused: "delta: the copies would overlap p1 by 24.0 LDU with the overlap check on, so nothing was pasted."
+- `origin` and `direction` (a pointer ray in the scene's axes), with `held`, `rotation` and `snap`: seat the group the way the window seats copies held under the pointer. Use this to let snapping find the studs; use `delta` when you know the place.
+
+```bash
+./formblocks cli run clipboard.copy 'ids=["p1","p2"]'
+./formblocks cli run clipboard.paste 'delta=[100,0,0]'
+./formblocks cli run clipboard.paste text=nonsense
+```
+
+The copy answered `count` 2 and the text of two lines; the paste with `delta [100, 0, 0]` answered two placements 100 LDU along X, in the step shown, with new ids; `text=nonsense` was refused with "text: there is no LDraw part line (a line starting with 1) to paste." and changed nothing.
+
+## Traps
+
+- New ids: the pasted parts are new placements (`p3`, `p4`), never the originals. Read their ids from the answer.
+- Paste goes into the step shown and the submodel being edited. Give nothing for them: set the step first with `step.goto`, or move the parts afterwards with `step.move_parts`.
+- A paste copies parts, never a part file's own lines, and lines that do not start with `1` are ignored.
+- A pasted group is not checked against the parts below unless the person's overlap check is on; read the answer, then `overlap.check`.
+- Repeating a unit many times is better done by packing it into a submodel (`sub-skills/submodels/SUB-SKILL.md`) than by pasting copies, because a change then shows in every use.
+- From outside the window `cut` and `paste` wait for the person's answer there; `copy` never does.
diff --git a/.claude/skills/formblocks-driving/sub-skills/clips-and-hinges/SUB-SKILL.md b/.claude/skills/formblocks-driving/sub-skills/clips-and-hinges/SUB-SKILL.md
index a54221b..0fce61c 100644
--- a/.claude/skills/formblocks-driving/sub-skills/clips-and-hinges/SUB-SKILL.md
+++ b/.claude/skills/formblocks-driving/sub-skills/clips-and-hinges/SUB-SKILL.md
@@ -34,6 +34,10 @@ The clip's centre is put on the bar's line, and it slides along the bar in grid
A floating bar is put exactly with `part.set_transform`, because `part.place` rounds an unseated part to the grid (the first line answered position `[4, -76, 4]` and `seated` false). With `on`, the clip took the first free stretch of the bar, its centre at y = -70. With a position, a clip whose centre was at y = -41 seated at -50, the nearest place at the Stud step. The clip of `4085c` is at `[0, 4, -20]` in the part's own axes (`part.connectors part=4085c`), so its origin ends up 4 above the clip's centre and 20 behind the bar's line. Always read `seated`, `joined` and `marks` in the answer.
+## Plates that carry a clip, handle or hinge finger
+
+From 0.6.0 such a plate seats on studs from above: `part.fit` of `4085c` and of `2540` over a `3001` at `[3, -12, 2]` answered `seated` true at `[10, -8, -10]` and `[0, -8, -10]`, each joined to the brick's studs. A bar's `ref` (read it with `part.connectors part=2540`: `[0, 0, 1]`, the side its own plate is on) and a clip's `ref` (`[0, 0, -1]` for `4085c`) now decide the turn: a clip mates only with its body turned away from the bar's part, and snapping never turns it, so turn the clip first. The second rule is read from the specification; a clip held near a bar high in the air did not seat in either turn when tried, so treat it as not shown working here and check `seated`.
+
## Seating hinge halves
Snapping never turns a part. Turn the half first so its pivot line runs the way its partner's does, then place it near: it moves so the two lines meet.
@@ -63,4 +67,4 @@ Two halves joined by a seated hinge answered `count` 0. A clip seated on a bar,
## Not found, not built
-A hinge or clip drawn without the library's own pieces is found only where the engine's list of corrections names it (the 1 x 2 hinge brick, the swivel plates, the 1 x 1 tile with a clip); other parts do not snap, so place them by position and say so. Pins, axles, ball joints, a bar into a hole, hinge turning limits, click positions and flexible parts are not built: do not promise them.
+A hinge or clip drawn without the library's own pieces is found only where the engine's list of corrections names it (the 1 x 2 hinge brick, the swivel plates, the 1 x 1 tile with a clip); other parts do not snap, so place them by position and say so. Pins and axles are in their own sub-skill (`sub-skills/pins-and-axles/SUB-SKILL.md`). Ball joints, a bar into a hole, hinge turning limits, click positions and flexible parts are not built: do not promise them.
diff --git a/.claude/skills/formblocks-driving/sub-skills/colours/SUB-SKILL.md b/.claude/skills/formblocks-driving/sub-skills/colours/SUB-SKILL.md
index ec4ccbb..48b6f50 100644
--- a/.claude/skills/formblocks-driving/sub-skills/colours/SUB-SKILL.md
+++ b/.claude/skills/formblocks-driving/sub-skills/colours/SUB-SKILL.md
@@ -45,6 +45,7 @@ Read the table again when in doubt; a library update can add colours, and the pe
- Recolouring a use of a submodel in colour 16 passes the new colour to the parts inside that are in 16; parts with their own colour keep it.
- `select.by_colour` selects every visible placement in a colour, then `part.recolour` without `ids` acts on that selection.
- `colours.used` (read) lists the colours the model uses, most used first, each with `code`, `name`, `value`, `count` and `known` (false for a code the library does not define): the quickest way to check a build's colours.
+- `colours.favourite` (view) with `colour` stars a colour in the person's palette (Starred); `on` true or false sets it, and left out it turns the star the other way. It answered `{colour: 4, on: true, favourite_colours: [4]}` and, run again, `on` false and an empty list. `colours.list` rows carry `favourite`, true for a starred colour. It is the person's setting and changes no part.
- `colours.current` (view) chooses the colour the person's next part from the palette gets. It is the person's setting and recolours nothing; an agent passes `colour` on each `part.place` instead and leaves it alone.
## Choosing colours for a build
diff --git a/.claude/skills/formblocks-driving/sub-skills/pins-and-axles/SUB-SKILL.md b/.claude/skills/formblocks-driving/sub-skills/pins-and-axles/SUB-SKILL.md
new file mode 100644
index 0000000..f201610
--- /dev/null
+++ b/.claude/skills/formblocks-driving/sub-skills/pins-and-axles/SUB-SKILL.md
@@ -0,0 +1,64 @@
+---
+name: pins-and-axles
+description: Seats pins and axles in beams, bushes and bricks with a hole in FormBlocks with part.fit, part.place, part.connectors and part.rotate about the pin. Use when asked to build with beams with holes, pins, friction pins, axles, bushes, or a brick with a hole, to join two beams with a pin, to put an axle through a beam, to turn a beam on its pin, or when a pin or axle will not seat or reads as a different kind than expected.
+---
+
+# Pins and axles
+
+Added in 0.6.0. The engine finds pins, axles and the holes they go into from a part's own shape, and snaps them with the same rule as studs and clips: `part.place`, `part.fit` and the window's drags all use it. Read what a part has with `part.connectors` (read; pass `kind` to list one kind).
+
+## The kinds
+
+| Kind | What it is | Pairs with |
+| --- | --- | --- |
+| `pin` | A round shaft that turns freely in a hole, 20 LDU long for a full pin, 10 for a half pin. | `pin_hole` |
+| `pin_friction` | The same shaft with friction ribs. The engine treats it as a pin; it does not hold an angle. | `pin_hole` |
+| `pin_hole` | A round bore, 20 deep in a beam. Takes a pin from either face, or an axle. | `pin`, `pin_friction`, `axle` |
+| `axle` | A cross-shaped shaft, 80 LDU for an Axle 4. | `axle_hole`, `pin_hole` |
+| `axle_hole` | A cross-shaped bore, as in a bush. | `axle` |
+
+A pin does not go into an axle hole, and neither pins nor axles go into studs or anti-studs. A pin hole takes an axle and lets it turn. Parts whose pins or holes are drawn without the library's own pieces are not found: place those by position and say so.
+
+## Joining two beams with a pin
+
+A pin joined to a beam is seated by its end. Turn the pin first, since snapping never turns a part: `3673` Technic Pin 1/2 has a pin at each end, and with the matrix `0 1 0 / -1 0 0 / 0 0 1` its first end points down.
+
+```bash
+./formblocks cli run part.place part=32524 colour=7 'position=[0,0,0]'
+./formblocks cli run part.set_transform id=p1 'position=[0,0,0]'
+./formblocks cli run part.place part=3673 colour=4 'position=[1,-13,2]' 'rotation=[0,1,0,-1,0,0,0,0,1]'
+./formblocks cli run part.place part=32524 colour=7 'position=[2,-24,-41]'
+```
+
+Run here: the pin answered `seated` true at `[0, -10, 0]` with one joined pair and a mark at `[0, 10, 0]`, and the second beam seated at `[0, -20, -40]`, joined to the pin. The first line rounded the beam to `[9, -2, 9]` (an unseated part goes to the grid), hence the `part.set_transform`. `overlap.check` answered `count` 0 and `nested_count` 0: a pin fitted in a hole is joined, not an overlap.
+
+## Turning a beam on its pin
+
+`part.pivot` on the second beam answers kind `hinge`, about `[0, -20, 0]` along the pin; give both to `part.rotate`.
+
+```bash
+./formblocks cli run part.pivot 'ids=["p3"]'
+./formblocks cli run part.rotate 'ids=["p3"]' 'axis_vector=[0,1,0]' 'about=[0,-20,0]' angle=45
+```
+
+The beam turned 45 degrees to `[-28.284, -20, -28.284]` and `overlap.check` still answered `count` 0. A beam turns all the way round on a pin; turning limits are not built.
+
+## An axle through a beam
+
+An axle is seated on a hole's line and slides along it in grid steps from its middle.
+
+```bash
+./formblocks cli run part.fit part=3705 'position=[1,-7,2]' 'rotation=[0,1,0,-1,0,0,0,0,1]'
+```
+
+Run here against the same lone beam: `3705` Axle 4, turned upright, answered `seated` true at `[0, 0, 0]` (the beam's middle hole), mark at `[0, -40, 0]`. Unturned, the same call answered `seated` false: the axle must run along the hole. A bush turned to take it was fitted at `[1, -48, 2]` and answered false in this run, with no axle there; seating a bush on an axle is described in the specification (`spec/CONNECTIONS.md`, example 11) and not run here.
+
+## Reading and failures
+
+- `part.connectors part=32524` lists seven `pin_hole` entries, each `length` 20.
+- `part.connectors part=3705` lists one `axle`, `length` 80.
+- When a pin or axle does not seat, check the turn first (axis along the hole), then the distance (within the snap reach of the hole), then that the hole is not already taken.
+
+## Not built
+
+Ball joints and sockets, gears meshing, flexible parts, other scales' pins (the Scala pin), turning limits, friction as a held angle, and click positions on axles. Do not promise them.
diff --git a/.claude/skills/formblocks-driving/sub-skills/placing-and-snapping/SUB-SKILL.md b/.claude/skills/formblocks-driving/sub-skills/placing-and-snapping/SUB-SKILL.md
index 43eb734..908bae0 100644
--- a/.claude/skills/formblocks-driving/sub-skills/placing-and-snapping/SUB-SKILL.md
+++ b/.claude/skills/formblocks-driving/sub-skills/placing-and-snapping/SUB-SKILL.md
@@ -12,7 +12,7 @@ Read `references/coordinates-and-units.md` first if positions in LDU with -Y up
- A stud is the round knob on top of a part, 4 LDU high, on a 20 LDU grid.
- An anti-stud is a place on a part's underside that takes one stud: the gaps between the walls and tubes of a brick, or the inside of a tube.
- A part is seated when its anti-studs sit on another part's studs (or its studs in another part's anti-studs). Seating is how real bricks hold together, so a model built of seated parts is one that could be built.
-- FormBlocks finds these connectors from each part's own geometry; `part.connectors` lists them for any part. Only ordinary studs and anti-studs exist in this version: pins, axles, clips and hinges do not seat.
+- FormBlocks finds these connectors from each part's own geometry; `part.connectors` lists them for any part. Studs and anti-studs are the ordinary joins; clips on bars and hinge halves seat too (`sub-skills/clips-and-hinges/SUB-SKILL.md`). Pins and axles seat in holes (`sub-skills/pins-and-axles/SUB-SKILL.md`); ball joints do not seat yet.
## The ground
@@ -41,7 +41,7 @@ With snapping off (`snap: false`), the part goes exactly to the position, seated
Snapping never turns a part. To seat crosswise, give the turned `rotation`.
-Snapping, the grid step and the overlap check are the person's settings: `snap.set` (`on`), `grid.step` (`stud`, `plate` or `fine`) and `overlap.set` (`on`) change them for every later placement, in the window too. Pass `snap` on one call instead, and change a setting only when the person asks.
+Snapping, the grid step and the overlap check are the person's settings: `snap.set` (`on`), `grid.step` (`stud`, `plate` or `fine`) and `overlap.set` (`on`) change them for every later placement, in the window too. `snap.toggle`, `overlap.toggle` and `grid.next` flip or step the same settings from the engine's own state, which is what the window's keys use, so two quick presses end where they began; prefer the `set` forms, which say the end state. Pass `snap` on one call instead, and change a setting only when the person asks.
A fourth way to say where is a pointer ray, as the window drops the ghost: `part.place_at_ray`, in the scene's axes. It also rests a part on what lies under its whole footprint, so a plate dropped over an open gap lies across the parts either side. `sub-skills/moving-parts/SUB-SKILL.md` covers it.
diff --git a/.claude/skills/formblocks-driving/sub-skills/selection/SUB-SKILL.md b/.claude/skills/formblocks-driving/sub-skills/selection/SUB-SKILL.md
index 2449d58..2872006 100644
--- a/.claude/skills/formblocks-driving/sub-skills/selection/SUB-SKILL.md
+++ b/.claude/skills/formblocks-driving/sub-skills/selection/SUB-SKILL.md
@@ -22,6 +22,10 @@ Selection commands are `view` commands: they change what is shown, never the mod
| `select.invert` | none | Every visible placement that was not selected, letting go of the rest. |
| `select.by_colour` | `colour` | Every visible placement in that colour, or in the colours of the selection when left out. |
| `select.by_part` | `part` | Every visible placement of that part, or of the parts of the selection when left out. A printed part counts as a different part. |
+| `select.by_part_colour` | `ids` | Every visible placement that matches one of the given placements, or of the selection, in both its part and its colour. |
+| `select.attached` | `ids` | The given placements, or the selection, and every visible placement joined to them through seated connectors, however far the chain goes; a use of a submodel joins nothing. |
+
+`select.by_colour`, `select.by_part`, `select.by_part_colour` and `select.attached` also take `add` (true): the matches are added to the selection instead of replacing it. In a model of two stacked red and blue 2 x 4 bricks, a red 2 x 2 plate on its own and a red 2 x 4 brick elsewhere, `select.attached` for the lower brick answered both stacked bricks and nothing else, and `select.by_colour` for red answered the three red parts.
## Rules
@@ -45,6 +49,7 @@ So you can follow what they tell you (`spec/SPEC.md` 6.1):
- A click selects one part; a click on empty space or the ground clears the selection. Shift+click adds a part; Ctrl+click (Cmd on macOS) adds it or takes it away.
- A drag that starts on empty space draws a selection box. Left to right selects the parts wholly inside it, right to left every part it touches. Shift with the box adds; Ctrl adds the parts not yet selected or, when all are, takes them away. Esc while drawing drops the box.
- A drag that starts on a part moves it, or the selection it belongs to (`sub-skills/moving-parts/SUB-SKILL.md`).
+- Q goes through the pick modes a click uses (one part, same colour, same part, same part and colour, attached), and the Select menu has the same four kinds; each reaches the engine as the matching `select.*` command.
- Ctrl+A selects all, Ctrl+I inverts, Esc clears. Rows of the Model, Steps and Parts tabs select their parts too.
The box needs the view, so it has no command: an agent selects by ids or by kind. Every selection the person makes reaches the engine as `select.*` commands, so `select.get` always answers what the window shows.
diff --git a/.claude/skills/formblocks-driving/sub-skills/steps/SUB-SKILL.md b/.claude/skills/formblocks-driving/sub-skills/steps/SUB-SKILL.md
index 8821ae3..6ee30e7 100644
--- a/.claude/skills/formblocks-driving/sub-skills/steps/SUB-SKILL.md
+++ b/.claude/skills/formblocks-driving/sub-skills/steps/SUB-SKILL.md
@@ -15,6 +15,8 @@ Each submodel has its own building steps, numbered from 1. Every placement is in
| `step.goto` | view | `index` or `to` | Shows step `index` of the submodel being edited, or the `first`, `previous`, `next` or `last` step. New parts go into the step shown. Walking a model step by step is `sub-skills/step-walking/SUB-SKILL.md`. |
| `step.break_after` | change | `id` | Starts a new step after placement `id`, moving the placements after it in its step into the new step. With no `id`, adds an empty step after the step shown and shows it. |
| `step.move_parts` | change | `ids`, `step` | Moves placements into another step of their submodel; one past the last starts a new step at the end. |
+| `step.move_to_new` | change | `ids` | Puts the placements into a new step right after the step shown, and shows it. With the step shown being 2 of 3, the placement went into a new step 3 and the old step 3 became 4. |
+| `step.reorder` | change | `step`, `to`, `submodel` | Moves a whole step, with its parts, to another place in the order; the steps between close up and are renumbered. With three steps of one brick each, `step=3 to=1` answered the old third step first. A `to` outside the steps ("to must be from 1 to 3 in untitled.ldr.") or equal to `step` ("step 1 is already number 1; nothing moved.") is refused. |
| `step.rename` | change | `step`, `name`, `submodel` | Names a step; an empty name clears it. |
| `step.delete` | change | `step`, `submodel` | Deletes a step; its placements move to the start of the next step, or to the end of the step before when it was the last. A submodel keeps at least one step. |
diff --git a/.claude/skills/formblocks-harness/SKILL.md b/.claude/skills/formblocks-harness/SKILL.md
index a0cc957..427d375 100644
--- a/.claude/skills/formblocks-harness/SKILL.md
+++ b/.claude/skills/formblocks-harness/SKILL.md
@@ -4,7 +4,7 @@ description: "Use when asked to install, boot, verify, debug, extend or release
license: Apache-2.0
metadata:
product: FormBlocks
- pack-version: "0.5.0"
+ pack-version: "0.6.0"
audience: developer agent
---
diff --git a/.claude/skills/formblocks-harness/sub-skills/add-connector-kind/SUB-SKILL.md b/.claude/skills/formblocks-harness/sub-skills/add-connector-kind/SUB-SKILL.md
index 1559257..e046f9a 100644
--- a/.claude/skills/formblocks-harness/sub-skills/add-connector-kind/SUB-SKILL.md
+++ b/.claude/skills/formblocks-harness/sub-skills/add-connector-kind/SUB-SKILL.md
@@ -1,6 +1,6 @@
---
name: add-connector-kind
-description: Adds a connector kind to FormBlocks' connection model as a module that registers itself in backend/app/connect/kinds/, with its data beside it as JSON. Use when adding a joint beyond studs, anti-studs, clips, bars and the hinge families, such as pins or axles, when correcting the primitive list of an existing kind, or when a part's connectors come out wrong.
+description: Adds a connector kind to FormBlocks' connection model as a module that registers itself in backend/app/connect/kinds/, with its data beside it as JSON. Use when adding a joint beyond studs, anti-studs, clips, bars, the hinge families, pins and axles, such as ball joints or gears, when correcting the primitive list of an existing kind, or when a part's connectors come out wrong.
---
# Add a connector kind
@@ -16,7 +16,7 @@ Load `sub-skills/laws-and-logs/SUB-SKILL.md` and `sub-skills/clean-room-and-spec
## Where the module lives
-- `backend/app/connect/kinds/[kind].py`, one module per kind or per family of kinds. `kinds.load()` imports every module in the package whose name does not start with `_`, in name order, so no list is edited anywhere.
+- `backend/app/connect/kinds/[kind].py`, one module per kind or per family of kinds (`pin.py` holds three pin kinds, `axle.py` two, and `_shaft.py` is the measuring they share). `kinds.load()` imports every module in the package whose name does not start with `_`, in name order, so no list is edited anywhere.
- The module's data (primitive file names, tolerances) sits beside it as `[kind].json` and is read when the module loads, so a list can be corrected without touching code. A data file that cannot be read stops the engine with a sentence naming the file.
- At the end of the module, one call per kind: `PIN = register(PinKind())`.
@@ -42,6 +42,10 @@ A subclass of `Kind` from `backend/app/connect/kinds/__init__.py`:
`kinds/clip.py` (clip and bar) and `kinds/hinge.py` (the five hinge families, three read from primitives and two from overrides only) are the worked examples; each has its numbers in `clip.json` or `hinge.json`. `mates_with` is declared once per kind and the registry makes it symmetric, so a half pairs only with the other half of its own family.
+`kinds/pin.py` (`pin`, `pin_friction`, `pin_hole`) and `kinds/axle.py` (`axle`, `axle_hole`), with `_shaft.py` for what they share, are the worked examples of a kind built in two passes. No primitive draws a whole hole, so `claims` and `from_reference` make one piece per open face (a face point and the inward direction), and `settle` joins the pieces once the walk is over: two faces that look at each other on one line, nearest first and at most `max_depth` apart, become one hole; a face left alone has its bore probed for its depth. A hole is a point with a depth: its `position` is the middle of the bore, its `axis` runs along it, its `length` is the depth from face to face, and the mate puts a pin's collar at the hole's near face, half the depth from `position` (`spec/CONNECTIONS.md`, "The mate of a pin in a hole"). A pin or an axle is a segment (`spans`), so a long one can take two holes.
+
+`version` is read from the top of the kind's JSON file (`"version"` in `pin.json`, `axle.json`, `clip.json`), not written in the module: raise it there in the same commit whenever the kind's rule or its data changes, and every cached part is derived again.
+
Connectors already carry `ref` (for kinds whose turn about the axis matters) and `length` (for kinds that slide), so the connector shape does not change.
## Overrides
diff --git a/.docs/wiki/Building.md b/.docs/wiki/Building.md
index 21f1e89..2400e1d 100644
--- a/.docs/wiki/Building.md
+++ b/.docs/wiki/Building.md
@@ -13,6 +13,8 @@ cd formblocks
./formblocks # the engine and the window together
```
+The launcher opens no browser: it prints its two addresses, you open `http://localhost:5330` yourself, and it runs until you close its terminal. `./formblocks serve` has the engine serve the built window on `http://127.0.0.1:8330` instead; it gives its key to the first page that loads, so use one tab there (a second shows "The engine did not answer").
+
On Windows use `formblocks_oc_install.bat` and `formblocks.bat`. Neither has been run yet; only Linux has run FormBlocks from source.
| Service | Address | Notes |
@@ -55,6 +57,6 @@ CI also boots the engine and probes `/api/health`, runs `bash -n` over the shell
## The desktop app and releases
-`./formblocks install-desktop` checks the toolchain, `./formblocks desktop dev` runs the shell and `./build_app` builds and installs it. The bundle takes its icons from `src-tauri/icons`, made from the owner's art in `assets/`. One desktop build has been run, on Linux x64 (a deb and an AppImage, unsigned, made as formcompiler makes them). Its frozen engine started, the window drew under a virtual display with software WebGL and opened the sample car, and closing it ended every process. The macOS and Windows builds, signing, the updater and the rpm have not been run.
+`./formblocks install-desktop` checks the toolchain, `./formblocks desktop dev` runs the shell and `./build_app` builds and installs it. The bundle takes its icons from `src-tauri/icons`, made from the owner's art in `assets/`. One desktop build has been run, on Linux x64 (a deb, an rpm and an AppImage, unsigned, made as formcompiler makes them). Each frozen engine started, the window drew under a virtual display with software WebGL and opened the sample car, and closing it ended every process. The macOS and Windows builds, signing and the updater have not been run. A start that fails shows the engine's reason in a dialog and ends the app; the same reasons print as one `formblocks-start-error:` line from the engine.
Nothing in this repository pushes, signs or publishes a release. The family's compiler, formcompiler, builds each release from `apps/formblocks.json` after `ci.yml` has passed on a `compile_vX.Y.Z` branch, and an owner publishes it. `docs/RELEASE.md` lists the version sites a release bumps by hand and says what formcompiler runs.
diff --git a/.docs/wiki/Home.md b/.docs/wiki/Home.md
index d127ed2..4e810a5 100644
--- a/.docs/wiki/Home.md
+++ b/.docs/wiki/Home.md
@@ -2,7 +2,7 @@
FormBlocks is an Apache-2.0 brick building app for macOS, Linux and Windows. You find parts in the open LDraw parts library, place and snap them in a 3D view, colour them, build in steps, count what the model needs, save LDraw files and pictures, and an agent program can do the same through the engine's command line and MCP server.
-Version: 0.5.0 (in active development, functional).
+Version: 0.6.0 (in active development, functional).
## Start here
diff --git a/.docs/wiki/Window.md b/.docs/wiki/Window.md
index 6f1191a..2a25584 100644
--- a/.docs/wiki/Window.md
+++ b/.docs/wiki/Window.md
@@ -10,11 +10,15 @@ The full walk through is `docs/MANUAL.md` in the repository. This page is the ma
## Turning parts
-Select parts and a pivot dial shows: one ring about the up axis. Drag along it to turn in angle steps, Shift for whole degrees, Esc to put the parts back. Press **A** for the next angle step (90, 45, 22.5, 15, 5 or 1 degrees), **J** for the pivot tool with three rings and a click to set the pivot, and hold Alt with **R**, **T** or **Y** to turn by the angle step. A turn never leaves a part under the ground. A hinge half turns about its hinge.
+Select parts and a pivot dial shows: one ring about the up axis. Drag along it to turn in angle steps, Shift for whole degrees, Esc to put the parts back. Press **A** for the next angle step (90, 45, 22.5, 15, 5 or 1 degrees), **J** for the pivot tool with three rings and a click to set the pivot, and hold Alt with **R**, **T** or **Y** to turn by the angle step. With the pivot tool on (**J**), type a number of degrees into the box at the foot of the view and press Enter to turn by exactly that (a minus sign turns the other way). A turn never leaves a part under the ground. A hinge half turns about its hinge.
## Clips and hinges
-A clip seats on a bar and slides along it in grid steps; two hinge halves of one family seat on one pivot line once the half is turned the right way round. The manual's "Clips, bars and hinges" lists the five hinge families and what is not built yet (pins, axles, ball joints, hinge limits).
+A clip seats on a bar and slides along it in grid steps; two hinge halves of one family seat on one pivot line once the half is turned the right way round. The manual's "Clips, bars and hinges" lists the five hinge families and what is not built yet (ball joints, hinge limits, a pin that holds its angle).
+
+## Pins and axles
+
+A pin seats in the round hole of a beam, and a beam over an upright pin takes the hole's line; an axle goes through a pin hole or a cross-shaped hole such as a bush's. Turn the part first, since snapping never turns a part. A beam on a pin turns about the pin. The manual's "Pins and axles" says more.
## Overlaps and nested pairs
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 27c00a7..f3af04d 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -100,6 +100,39 @@ jobs:
sys.exit(1 if bad else 0)
PY
+ desktop:
+ needs: [frontend, backend]
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [macos-latest, macos-15-intel, windows-latest]
+ runs-on: ${{ matrix.os }}
+ timeout-minutes: 45
+ defaults:
+ run:
+ shell: bash
+ steps:
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ with:
+ persist-credentials: false
+ - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
+ with:
+ node-version-file: .nvmrc
+ cache: npm
+ cache-dependency-path: frontend/package-lock.json
+ - uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
+ with:
+ python-version: '3.12'
+ - name: Install as formcompiler does
+ run: |
+ ./formblocks install --lite
+ ./formblocks install-desktop
+ - name: Freeze the engine and run its self-check
+ run: ./formblocks freeze
+ - name: Type check the shell with the frozen engine in place
+ working-directory: src-tauri
+ run: cargo check --locked
+
agents:
runs-on: ubuntu-24.04
timeout-minutes: 15
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1c45d44..ac24664 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,27 @@
# Changelog
+## v0.6.0 · 2026-11-27
+
+The sixth version adds pins and axles as joins, lets plates with a clip, a handle or a hinge finger sit on studs, brings the clipboard and more editing tools, and makes the panels fit short windows. The repository is private until 13 December 2026.
+
+- Pins and axles: a pin seats in a pin hole and an axle slides through axle holes in grid steps, found from each part's own shape; 2,458 parts of the official library gain such a join. A part held on one pin or one axle turns about it with the pivot tool. A seated pin counts as fitted in the overlap check.
+- Plates with a side piece sit on studs: a plate that carries a clip, a handle or a hinge finger now seats on studs from above with its side piece over the edge, and takes a plate on its own studs. 1,095 parts gain the hollows that make this work; no part lost one. Worked examples 5 to 8 of the connection specification are recomputed on purpose; examples 1 to 4 and every brick-on-brick number are unchanged.
+- A clip keeps its own body clear: a clip seats on a bar only when it is held with its body pointing away from the bar's part. Held the wrong way it is not offered the bar; turn it and it seats. Snapping still never turns a part.
+- Copy, cut and paste (Ctrl+C, Ctrl+X, Ctrl+V): pasted parts are held on the pointer and seat by the snap. Also new: a stamp (C) and a brush (B) that place the held part again by click or by stroke, a sampler (I) that takes a part and colour from the model, move handles (M), an orthographic view (P), Select Attached, Select Same Part and Colour, and an Add option on the select-by-kind commands. A part dragged from the palette is placed where it is dropped.
+- Typing an angle: with the pivot tool on, type degrees and press Enter to turn by exactly that.
+- With the overlap check on, a nudge or a typed position can no longer push a part into another. Pressing a status-bar switch twice quickly now always counts twice, and Ctrl+Z during a drag cancels the drag instead of undoing an earlier change.
+- The right column on short windows: the colour palette shows whole rows of swatches, Details is never cut through a row, and the tab in use keeps at least four rows; all three sections fit at 1024 by 700. Recent, used and starred colours share one row, and S or a right click stars a colour.
+- Model tree and steps: a row menu (right click, the menu key or Shift+F10) packs parts into a submodel, renames, makes independent, unpacks, hides and deletes; Ctrl+G and Ctrl+Shift+G pack and unpack. Parts and steps can be dragged to another place or moved with Alt+Up and Alt+Down; F2 renames a step.
+- The Info tab says, quietly, when the model inside a file has a different name from the file. Nothing is renamed for you.
+- Preferences has a Building page with the angle step and how much earlier steps fade. A parts list sorted by colour is saved grouped by colour.
+- Keyboard: Ctrl+A, Ctrl+C, Ctrl+X and the other editing keys stay with a text field while you type in it. Lists, the palette grids and groups of choices are one Tab stop each and move with the arrow keys, and every control shows where the focus is.
+- Without WebGL 2 the viewport says so in a sentence instead of staying blank.
+- The desktop app: every start-up failure now ends in a sentence you can act on (the engine missing, a data folder that cannot be written, a second copy already open, an engine that does not answer); before, a missing engine left no window at all. The Linux build makes a deb, an rpm and an AppImage.
+- Agents: `clipboard.copy`, `clipboard.cut`, `clipboard.paste`, `select.attached`, `select.by_part_colour`, `step.reorder`, `step.move_to_new`, `colours.favourite`, and the switches `snap.toggle`, `overlap.toggle`, `overlap.nested_toggle`, `grid.next` and `angle.next`. `part.connectors` lists pins, axles and their holes. Two new sub-skills in the driving pack: the clipboard, and pins and axles. The manual has a new chapter, "A first model".
+- Run for this version: `./formblocks doctor`, the type check, the window build, the engine freeze with its self-check, `./formblocks agents check`, the Form App Contract checker (0 MUST, 0 SHOULD, 83 clauses checked) and the registry's eight checks, all passing; the Linux desktop build as formcompiler runs it (deb, rpm, AppImage, unsigned), each started under a virtual display with the sample car drawn and a brick placed; headless Chrome walks with real pointer and key events (a clip plate on a handle the right way and the wrong way, a pin in a beam, a second beam turned a typed 180 degrees about the pin, an axle through both, copy and paste, the brush, steps dragged, a submodel packed and entered, save and reopen) with layout shift 0 on a hard reload and without recent input under a 4x slower processor and a slow network. Claude Code 2.1.332 was a real program, not signed in.
+- Not run for this version: a signed-in agent turn, any `.bat` script, Windows, macOS, a desktop build after the last window fixes, the workflow on GitHub, and a frame time on a real graphics card.
+- Known: what counts as an overlap is still the owner's decision, and the check still cannot tell a part pushed in by exactly 1 LDU from one that sits there by design; a hide tool, a right-click menu in the viewport, saved camera views and changing a key are not built; a saved parts list groups colours by number while the table sorts them by name; a picture still cannot be drawn with no window open.
+
## v0.5.0 · 2026-11-27
The fifth version turns parts with the pointer, adds clips, bars and hinges as joins, makes the overlap check quiet on real models, gives the right column room and a model information tab, and was built and started as a desktop app for the first time, on Linux. The repository is private until 13 December 2026.
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 118ae27..8479393 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -37,7 +37,7 @@ Run what CI runs:
CI also boots the engine and probes `/api/health`, runs `bash -n` over the shell scripts, and fails on a long dash in tracked markdown or a pictograph in tracked text.
- Keep each pull request to one change.
-- Write commit subjects the way the history does: `type(scope): lowercase sentence describing the effect (x.y.z)`. Leave the version alone; a maintainer bumps every version site together when releasing.
+- Write commit subjects the way the history does: `type(scope): lowercase sentence describing the effect (x.y.z)`, where `type` is one of feat, fix, docs, refactor, perf, chore, style, build or ci, a scope in brackets is always given, and the first word after the colon is lowercase. A subject that breaks this cannot be repaired once the history is signed. Leave the version alone; a maintainer bumps every version site together when releasing.
- A feature is a command in the engine's registry, so the window, the command line and the MCP server all get it. Run `./formblocks agents sync` after adding one and commit what it writes.
- Every route that changes something needs the window's key. The engine binds 127.0.0.1 and nothing else.
- The window renders once and patches in place: no flash, no flicker, no re-render of a live container. Colours, spacing and `z-index` come from the tokens file; icons are inline SVG from the app's own icon module.
diff --git a/NOTICE.md b/NOTICE.md
index 0e99a4a..f967492 100644
--- a/NOTICE.md
+++ b/NOTICE.md
@@ -46,11 +46,11 @@ FormBlocks was made from FormAnything's app template, which is FormCAD's skeleto
| Work | Licence | Where |
| --- | --- | --- |
-| tauri 2, tauri-plugin-shell, tauri-plugin-dialog, tauri-plugin-single-instance, regex, serde, serde_json | MIT OR Apache-2.0 | `src-tauri/Cargo.toml`, exact versions in `src-tauri/Cargo.lock` |
+| tauri 2.12.5, tauri-plugin-shell 2.6.0, tauri-plugin-single-instance 2.5.5, regex 1.13.1, serde 1.0.229, serde_json 1.0.154 | MIT OR Apache-2.0 | `src-tauri/Cargo.toml`, the versions as `src-tauri/Cargo.lock` holds them |
| tauri-plugin-dialog 2.8.4 | MIT OR Apache-2.0; the desktop's file dialogs for open, save and choosing a library folder, allowed to the window by `dialog:allow-open` and `dialog:allow-save` and called through `@tauri-apps/api` without its own JavaScript package | `src-tauri/Cargo.toml`, `src-tauri/capabilities/default.json`, `frontend/src/io/dialog.ts` |
| tauri-build 2.7.4 | MIT OR Apache-2.0; the shell's build script, not shipped | `src-tauri/Cargo.toml` (build dependency), exact version in `src-tauri/Cargo.lock` |
| windows-sys 0.61.2 (Windows) | MIT OR Apache-2.0 | `src-tauri/Cargo.toml` |
-| objc2, objc2-app-kit (macOS) | MIT OR Apache-2.0 OR Zlib | `src-tauri/Cargo.toml` |
+| objc2 0.6.5, objc2-app-kit 0.3.2 (macOS) | MIT (objc2), Zlib OR Apache-2.0 OR MIT (objc2-app-kit) | `src-tauri/Cargo.toml`, the versions as `src-tauri/Cargo.lock` holds them |
### The app's own art
diff --git a/README.md b/README.md
index 2c5c0e8..a5d370a 100644
--- a/README.md
+++ b/README.md
@@ -11,7 +11,7 @@
-
+
@@ -31,7 +31,7 @@
## What it is
-FormBlocks is an open brick building app. Its parts are the LDraw Parts Library, the open library of brick shapes kept by many authors at ldraw.org; FormBlocks fetches it once, after you agree, or reads a copy you already have, and never bundles it. Models are LDraw files, so they open in every other LDraw program. It is written from its own functional specification in [`spec/`](spec), not from any other program.
+FormBlocks is an open brick building app for anyone who designs models from bricks on a computer, whether by hand or with an agent program, and wants files that other LDraw programs open too. Its parts are the LDraw Parts Library, an open library of brick shapes kept by many authors at ldraw.org and licensed CC BY 2.0 and CC BY 4.0; FormBlocks fetches it once, only after you agree to the address, size and licence it shows, or reads a copy you already have, and never bundles it. It is written from its own functional specification in [`spec/`](spec), not from any other program.
@@ -42,11 +42,11 @@ FormBlocks is an open brick building app. Its parts are the LDraw Parts Library,