From 312dabecb341d054a795befefb33330e608e596e Mon Sep 17 00:00:00 2001 From: Andrew Bartels Date: Tue, 1 Dec 2026 09:53:36 -0800 Subject: [PATCH] docs: add the threaded bolt with runouts to the README demo table, and archive six finished plans The README demo table gains the thread runouts demo: an M6 thread fading out along the helix's tangent, then an M6 bolt threaded to its collar with a DIN 76-1 undercut and a chamfered end. Archived after the user's live sign-offs: appearance-and-reference-tools, modelled-threads, drawing-sheets, drawing-view-keeps-sheet-scale, equations-and-global-variables (the two small block demos) and title-block-fit-every-field (the drawing-package rerun). Their specs are merged into openspec/specs and the work-queue rows are marked done. --- README.md | 3 + .../.openspec.yaml | 0 .../design.md | 0 .../proposal.md | 0 .../specs/tools/appearance/spec.md | 0 .../specs/tools/reference-extras/spec.md | 0 .../tasks.md | 0 .../2026-12-01-drawing-sheets}/.openspec.yaml | 0 .../2026-12-01-drawing-sheets}/design.md | 0 .../2026-12-01-drawing-sheets}/proposal.md | 0 .../specs/tools/drawing-sheets/spec.md | 0 .../2026-12-01-drawing-sheets}/tasks.md | 0 .../.openspec.yaml | 0 .../design.md | 0 .../proposal.md | 0 .../tools/drawing-view-placement/spec.md | 0 .../tasks.md | 0 .../.openspec.yaml | 0 .../design.md | 0 .../proposal.md | 0 .../specs/tools/equations/spec.md | 0 .../specs/tools/sketch-text/spec.md | 0 .../tasks.md | 2 +- .../.openspec.yaml | 0 .../2026-12-01-modelled-threads}/design.md | 0 .../2026-12-01-modelled-threads}/proposal.md | 0 .../specs/tools/threads/spec.md | 0 .../2026-12-01-modelled-threads}/tasks.md | 0 .../.openspec.yaml | 0 .../proposal.md | 0 .../tools/drawing-package-title-block/spec.md | 0 .../tasks.md | 6 +- openspec/queue.md | 12 +- openspec/specs/tools/appearance/spec.md | 56 ++++++++ .../tools/drawing-package-title-block/spec.md | 45 ++++++ openspec/specs/tools/drawing-sheets/spec.md | 43 ++++++ .../tools/drawing-view-placement/spec.md | 25 ++++ openspec/specs/tools/equations/spec.md | 68 +++++++++ openspec/specs/tools/reference-extras/spec.md | 58 ++++++++ openspec/specs/tools/sketch-text/spec.md | 71 +++++++++ openspec/specs/tools/threads/spec.md | 136 ++++++++++++++++++ 41 files changed, 515 insertions(+), 10 deletions(-) rename openspec/changes/{appearance-and-reference-tools => archive/2026-12-01-appearance-and-reference-tools}/.openspec.yaml (100%) rename openspec/changes/{appearance-and-reference-tools => archive/2026-12-01-appearance-and-reference-tools}/design.md (100%) rename openspec/changes/{appearance-and-reference-tools => archive/2026-12-01-appearance-and-reference-tools}/proposal.md (100%) rename openspec/changes/{appearance-and-reference-tools => archive/2026-12-01-appearance-and-reference-tools}/specs/tools/appearance/spec.md (100%) rename openspec/changes/{appearance-and-reference-tools => archive/2026-12-01-appearance-and-reference-tools}/specs/tools/reference-extras/spec.md (100%) rename openspec/changes/{appearance-and-reference-tools => archive/2026-12-01-appearance-and-reference-tools}/tasks.md (100%) rename openspec/changes/{drawing-sheets => archive/2026-12-01-drawing-sheets}/.openspec.yaml (100%) rename openspec/changes/{drawing-sheets => archive/2026-12-01-drawing-sheets}/design.md (100%) rename openspec/changes/{drawing-sheets => archive/2026-12-01-drawing-sheets}/proposal.md (100%) rename openspec/changes/{drawing-sheets => archive/2026-12-01-drawing-sheets}/specs/tools/drawing-sheets/spec.md (100%) rename openspec/changes/{drawing-sheets => archive/2026-12-01-drawing-sheets}/tasks.md (100%) rename openspec/changes/{drawing-view-keeps-sheet-scale => archive/2026-12-01-drawing-view-keeps-sheet-scale}/.openspec.yaml (100%) rename openspec/changes/{drawing-view-keeps-sheet-scale => archive/2026-12-01-drawing-view-keeps-sheet-scale}/design.md (100%) rename openspec/changes/{drawing-view-keeps-sheet-scale => archive/2026-12-01-drawing-view-keeps-sheet-scale}/proposal.md (100%) rename openspec/changes/{drawing-view-keeps-sheet-scale => archive/2026-12-01-drawing-view-keeps-sheet-scale}/specs/tools/drawing-view-placement/spec.md (100%) rename openspec/changes/{drawing-view-keeps-sheet-scale => archive/2026-12-01-drawing-view-keeps-sheet-scale}/tasks.md (100%) rename openspec/changes/{equations-and-global-variables => archive/2026-12-01-equations-and-global-variables}/.openspec.yaml (100%) rename openspec/changes/{equations-and-global-variables => archive/2026-12-01-equations-and-global-variables}/design.md (100%) rename openspec/changes/{equations-and-global-variables => archive/2026-12-01-equations-and-global-variables}/proposal.md (100%) rename openspec/changes/{equations-and-global-variables => archive/2026-12-01-equations-and-global-variables}/specs/tools/equations/spec.md (100%) rename openspec/changes/{equations-and-global-variables => archive/2026-12-01-equations-and-global-variables}/specs/tools/sketch-text/spec.md (100%) rename openspec/changes/{equations-and-global-variables => archive/2026-12-01-equations-and-global-variables}/tasks.md (97%) rename openspec/changes/{modelled-threads => archive/2026-12-01-modelled-threads}/.openspec.yaml (100%) rename openspec/changes/{modelled-threads => archive/2026-12-01-modelled-threads}/design.md (100%) rename openspec/changes/{modelled-threads => archive/2026-12-01-modelled-threads}/proposal.md (100%) rename openspec/changes/{modelled-threads => archive/2026-12-01-modelled-threads}/specs/tools/threads/spec.md (100%) rename openspec/changes/{modelled-threads => archive/2026-12-01-modelled-threads}/tasks.md (100%) rename openspec/changes/{title-block-fit-every-field => archive/2026-12-01-title-block-fit-every-field}/.openspec.yaml (100%) rename openspec/changes/{title-block-fit-every-field => archive/2026-12-01-title-block-fit-every-field}/proposal.md (100%) rename openspec/changes/{title-block-fit-every-field => archive/2026-12-01-title-block-fit-every-field}/specs/tools/drawing-package-title-block/spec.md (100%) rename openspec/changes/{title-block-fit-every-field => archive/2026-12-01-title-block-fit-every-field}/tasks.md (83%) create mode 100644 openspec/specs/tools/appearance/spec.md create mode 100644 openspec/specs/tools/drawing-package-title-block/spec.md create mode 100644 openspec/specs/tools/drawing-sheets/spec.md create mode 100644 openspec/specs/tools/drawing-view-placement/spec.md create mode 100644 openspec/specs/tools/equations/spec.md create mode 100644 openspec/specs/tools/reference-extras/spec.md create mode 100644 openspec/specs/tools/sketch-text/spec.md create mode 100644 openspec/specs/tools/threads/spec.md diff --git a/README.md b/README.md index 0d86663c..83b3f78c 100644 --- a/README.md +++ b/README.md @@ -194,6 +194,9 @@ Each GIF is a live test driving SolidWorks 2026 through the MCP tools, with the A steel combination wrench sized by one global variable and lettered with its size: 13 mm, then 19 mm, then 8 mm in its own configuration
One variable sizes a combination wrench: equations and configurations A cube and a sphere as separate bodies: joined, each cut by the other, their common quarter, and the exclusive or
Boolean logic on a cube and a sphere: every combine of two bodies + +An M6 thread whose groove fades out along the helix's tangent, then an M6 bolt threaded to its collar with a DIN 76-1 undercut and a chamfered end
A threaded M6 bolt: a faded runout, then a DIN 76-1 undercut at the collar + **[See every demo in the docs](https://andrewbartels1.com/SolidworksMCP-python/demos/)**: what each one shows, its prompt, every tool call with its arguments (all 58 for the demo at the top), and how to run them yourself. diff --git a/openspec/changes/appearance-and-reference-tools/.openspec.yaml b/openspec/changes/archive/2026-12-01-appearance-and-reference-tools/.openspec.yaml similarity index 100% rename from openspec/changes/appearance-and-reference-tools/.openspec.yaml rename to openspec/changes/archive/2026-12-01-appearance-and-reference-tools/.openspec.yaml diff --git a/openspec/changes/appearance-and-reference-tools/design.md b/openspec/changes/archive/2026-12-01-appearance-and-reference-tools/design.md similarity index 100% rename from openspec/changes/appearance-and-reference-tools/design.md rename to openspec/changes/archive/2026-12-01-appearance-and-reference-tools/design.md diff --git a/openspec/changes/appearance-and-reference-tools/proposal.md b/openspec/changes/archive/2026-12-01-appearance-and-reference-tools/proposal.md similarity index 100% rename from openspec/changes/appearance-and-reference-tools/proposal.md rename to openspec/changes/archive/2026-12-01-appearance-and-reference-tools/proposal.md diff --git a/openspec/changes/appearance-and-reference-tools/specs/tools/appearance/spec.md b/openspec/changes/archive/2026-12-01-appearance-and-reference-tools/specs/tools/appearance/spec.md similarity index 100% rename from openspec/changes/appearance-and-reference-tools/specs/tools/appearance/spec.md rename to openspec/changes/archive/2026-12-01-appearance-and-reference-tools/specs/tools/appearance/spec.md diff --git a/openspec/changes/appearance-and-reference-tools/specs/tools/reference-extras/spec.md b/openspec/changes/archive/2026-12-01-appearance-and-reference-tools/specs/tools/reference-extras/spec.md similarity index 100% rename from openspec/changes/appearance-and-reference-tools/specs/tools/reference-extras/spec.md rename to openspec/changes/archive/2026-12-01-appearance-and-reference-tools/specs/tools/reference-extras/spec.md diff --git a/openspec/changes/appearance-and-reference-tools/tasks.md b/openspec/changes/archive/2026-12-01-appearance-and-reference-tools/tasks.md similarity index 100% rename from openspec/changes/appearance-and-reference-tools/tasks.md rename to openspec/changes/archive/2026-12-01-appearance-and-reference-tools/tasks.md diff --git a/openspec/changes/drawing-sheets/.openspec.yaml b/openspec/changes/archive/2026-12-01-drawing-sheets/.openspec.yaml similarity index 100% rename from openspec/changes/drawing-sheets/.openspec.yaml rename to openspec/changes/archive/2026-12-01-drawing-sheets/.openspec.yaml diff --git a/openspec/changes/drawing-sheets/design.md b/openspec/changes/archive/2026-12-01-drawing-sheets/design.md similarity index 100% rename from openspec/changes/drawing-sheets/design.md rename to openspec/changes/archive/2026-12-01-drawing-sheets/design.md diff --git a/openspec/changes/drawing-sheets/proposal.md b/openspec/changes/archive/2026-12-01-drawing-sheets/proposal.md similarity index 100% rename from openspec/changes/drawing-sheets/proposal.md rename to openspec/changes/archive/2026-12-01-drawing-sheets/proposal.md diff --git a/openspec/changes/drawing-sheets/specs/tools/drawing-sheets/spec.md b/openspec/changes/archive/2026-12-01-drawing-sheets/specs/tools/drawing-sheets/spec.md similarity index 100% rename from openspec/changes/drawing-sheets/specs/tools/drawing-sheets/spec.md rename to openspec/changes/archive/2026-12-01-drawing-sheets/specs/tools/drawing-sheets/spec.md diff --git a/openspec/changes/drawing-sheets/tasks.md b/openspec/changes/archive/2026-12-01-drawing-sheets/tasks.md similarity index 100% rename from openspec/changes/drawing-sheets/tasks.md rename to openspec/changes/archive/2026-12-01-drawing-sheets/tasks.md diff --git a/openspec/changes/drawing-view-keeps-sheet-scale/.openspec.yaml b/openspec/changes/archive/2026-12-01-drawing-view-keeps-sheet-scale/.openspec.yaml similarity index 100% rename from openspec/changes/drawing-view-keeps-sheet-scale/.openspec.yaml rename to openspec/changes/archive/2026-12-01-drawing-view-keeps-sheet-scale/.openspec.yaml diff --git a/openspec/changes/drawing-view-keeps-sheet-scale/design.md b/openspec/changes/archive/2026-12-01-drawing-view-keeps-sheet-scale/design.md similarity index 100% rename from openspec/changes/drawing-view-keeps-sheet-scale/design.md rename to openspec/changes/archive/2026-12-01-drawing-view-keeps-sheet-scale/design.md diff --git a/openspec/changes/drawing-view-keeps-sheet-scale/proposal.md b/openspec/changes/archive/2026-12-01-drawing-view-keeps-sheet-scale/proposal.md similarity index 100% rename from openspec/changes/drawing-view-keeps-sheet-scale/proposal.md rename to openspec/changes/archive/2026-12-01-drawing-view-keeps-sheet-scale/proposal.md diff --git a/openspec/changes/drawing-view-keeps-sheet-scale/specs/tools/drawing-view-placement/spec.md b/openspec/changes/archive/2026-12-01-drawing-view-keeps-sheet-scale/specs/tools/drawing-view-placement/spec.md similarity index 100% rename from openspec/changes/drawing-view-keeps-sheet-scale/specs/tools/drawing-view-placement/spec.md rename to openspec/changes/archive/2026-12-01-drawing-view-keeps-sheet-scale/specs/tools/drawing-view-placement/spec.md diff --git a/openspec/changes/drawing-view-keeps-sheet-scale/tasks.md b/openspec/changes/archive/2026-12-01-drawing-view-keeps-sheet-scale/tasks.md similarity index 100% rename from openspec/changes/drawing-view-keeps-sheet-scale/tasks.md rename to openspec/changes/archive/2026-12-01-drawing-view-keeps-sheet-scale/tasks.md diff --git a/openspec/changes/equations-and-global-variables/.openspec.yaml b/openspec/changes/archive/2026-12-01-equations-and-global-variables/.openspec.yaml similarity index 100% rename from openspec/changes/equations-and-global-variables/.openspec.yaml rename to openspec/changes/archive/2026-12-01-equations-and-global-variables/.openspec.yaml diff --git a/openspec/changes/equations-and-global-variables/design.md b/openspec/changes/archive/2026-12-01-equations-and-global-variables/design.md similarity index 100% rename from openspec/changes/equations-and-global-variables/design.md rename to openspec/changes/archive/2026-12-01-equations-and-global-variables/design.md diff --git a/openspec/changes/equations-and-global-variables/proposal.md b/openspec/changes/archive/2026-12-01-equations-and-global-variables/proposal.md similarity index 100% rename from openspec/changes/equations-and-global-variables/proposal.md rename to openspec/changes/archive/2026-12-01-equations-and-global-variables/proposal.md diff --git a/openspec/changes/equations-and-global-variables/specs/tools/equations/spec.md b/openspec/changes/archive/2026-12-01-equations-and-global-variables/specs/tools/equations/spec.md similarity index 100% rename from openspec/changes/equations-and-global-variables/specs/tools/equations/spec.md rename to openspec/changes/archive/2026-12-01-equations-and-global-variables/specs/tools/equations/spec.md diff --git a/openspec/changes/equations-and-global-variables/specs/tools/sketch-text/spec.md b/openspec/changes/archive/2026-12-01-equations-and-global-variables/specs/tools/sketch-text/spec.md similarity index 100% rename from openspec/changes/equations-and-global-variables/specs/tools/sketch-text/spec.md rename to openspec/changes/archive/2026-12-01-equations-and-global-variables/specs/tools/sketch-text/spec.md diff --git a/openspec/changes/equations-and-global-variables/tasks.md b/openspec/changes/archive/2026-12-01-equations-and-global-variables/tasks.md similarity index 97% rename from openspec/changes/equations-and-global-variables/tasks.md rename to openspec/changes/archive/2026-12-01-equations-and-global-variables/tasks.md index 99ae836b..a47a5f43 100644 --- a/openspec/changes/equations-and-global-variables/tasks.md +++ b/openspec/changes/archive/2026-12-01-equations-and-global-variables/tasks.md @@ -23,4 +23,4 @@ - [x] 4.7 `add_sketch_text` (design: Text on the wrench's handle): adapter (`InsertSketchText` at a point, `CharHeight`, `center_at` by measuring its edges), `base`/`circuit_breaker`/`connection_pool`/mock, the tool, hints, support level, toolset, catalog; tests. The wrench debosses "solidworksmcp-python" and its size (`$PRP:` linked to a Size dimension) into both faces of the handle, centred at every size (cut on a spare block, patterned onto the handle by `"Size" * 6.48 + 190mm`), and each evidence line shows the equation set and the size before and after - [x] 4.8 `set_sketch_text` (design: Text on the wrench's handle): re-letter a sketch's text in edit mode, rebuild; adapter, wrappers, mock, tool, hints, support level, catalog, tool count 145; tests. The wrench demo re-letters after each size change - [x] 4.6 Once the user approves the wrench: re-record, then the demos page section, README tile, catalog notes and CHANGELOG (approved and recorded 2026-11-18: 27 equations, captions at the start of each step) -- [ ] 4.4 The user runs `tests/live/test_live_sw_equations.py` (block tests) and approves the demo; archive after +- [x] 4.4 The user runs `tests/live/test_live_sw_equations.py` (block tests) and approves the demo; archive after diff --git a/openspec/changes/modelled-threads/.openspec.yaml b/openspec/changes/archive/2026-12-01-modelled-threads/.openspec.yaml similarity index 100% rename from openspec/changes/modelled-threads/.openspec.yaml rename to openspec/changes/archive/2026-12-01-modelled-threads/.openspec.yaml diff --git a/openspec/changes/modelled-threads/design.md b/openspec/changes/archive/2026-12-01-modelled-threads/design.md similarity index 100% rename from openspec/changes/modelled-threads/design.md rename to openspec/changes/archive/2026-12-01-modelled-threads/design.md diff --git a/openspec/changes/modelled-threads/proposal.md b/openspec/changes/archive/2026-12-01-modelled-threads/proposal.md similarity index 100% rename from openspec/changes/modelled-threads/proposal.md rename to openspec/changes/archive/2026-12-01-modelled-threads/proposal.md diff --git a/openspec/changes/modelled-threads/specs/tools/threads/spec.md b/openspec/changes/archive/2026-12-01-modelled-threads/specs/tools/threads/spec.md similarity index 100% rename from openspec/changes/modelled-threads/specs/tools/threads/spec.md rename to openspec/changes/archive/2026-12-01-modelled-threads/specs/tools/threads/spec.md diff --git a/openspec/changes/modelled-threads/tasks.md b/openspec/changes/archive/2026-12-01-modelled-threads/tasks.md similarity index 100% rename from openspec/changes/modelled-threads/tasks.md rename to openspec/changes/archive/2026-12-01-modelled-threads/tasks.md diff --git a/openspec/changes/title-block-fit-every-field/.openspec.yaml b/openspec/changes/archive/2026-12-01-title-block-fit-every-field/.openspec.yaml similarity index 100% rename from openspec/changes/title-block-fit-every-field/.openspec.yaml rename to openspec/changes/archive/2026-12-01-title-block-fit-every-field/.openspec.yaml diff --git a/openspec/changes/title-block-fit-every-field/proposal.md b/openspec/changes/archive/2026-12-01-title-block-fit-every-field/proposal.md similarity index 100% rename from openspec/changes/title-block-fit-every-field/proposal.md rename to openspec/changes/archive/2026-12-01-title-block-fit-every-field/proposal.md diff --git a/openspec/changes/title-block-fit-every-field/specs/tools/drawing-package-title-block/spec.md b/openspec/changes/archive/2026-12-01-title-block-fit-every-field/specs/tools/drawing-package-title-block/spec.md similarity index 100% rename from openspec/changes/title-block-fit-every-field/specs/tools/drawing-package-title-block/spec.md rename to openspec/changes/archive/2026-12-01-title-block-fit-every-field/specs/tools/drawing-package-title-block/spec.md diff --git a/openspec/changes/title-block-fit-every-field/tasks.md b/openspec/changes/archive/2026-12-01-title-block-fit-every-field/tasks.md similarity index 83% rename from openspec/changes/title-block-fit-every-field/tasks.md rename to openspec/changes/archive/2026-12-01-title-block-fit-every-field/tasks.md index 5015d330..bd290ce0 100644 --- a/openspec/changes/title-block-fit-every-field/tasks.md +++ b/openspec/changes/archive/2026-12-01-title-block-fit-every-field/tasks.md @@ -5,7 +5,7 @@ ## 1b. Subtitle (the user's question on #158: follow standard practice) - [x] 1b.1 ISO 7200: `subtitle` is the supplementary title, the TITLE's second line; the company field holds `company` only; the TITLE at 60% of the format's height (or the caller's cap); unit tests -- [ ] 1b.2 Live: the drawing test passes a subtitle and checks the TITLE's two lines +- [x] 1b.2 Live: the drawing test passes a subtitle and checks the TITLE's two lines ## 2. Docs @@ -14,5 +14,5 @@ ## 3. Live -- [ ] 3.1 `test_generate_drawing_package_on_a_block` asserts every listed field fits; run by the user -- [ ] 3.2 Archive after the user's pass +- [x] 3.1 `test_generate_drawing_package_on_a_block` asserts every listed field fits; run by the user +- [x] 3.2 Archive after the user's pass diff --git a/openspec/queue.md b/openspec/queue.md index 61a464b0..3f01d73f 100644 --- a/openspec/queue.md +++ b/openspec/queue.md @@ -39,21 +39,21 @@ Last updated 2026-11-25. | 26 | `execute_macro` runs VBA source text (a `generate_vba_*` result, or the agent's own), saved as a `.swb` and run with the dialog watchdog. Opt-in (`SOLIDWORKS_MCP_ALLOW_VBA_SOURCE`), the user's choice 2026-11-17 | #96 | `macro-from-vba-source` (archived) | Done 2026-11-17 (#246), checked live | | 27 | `save_body_as_part` leaves an extra unsaved assembly open (the Save Bodies feature's create-assembly option) | #101 | `save-body-no-stray-assembly` (archived) | Done 2026-11-17 (#247), checked live: the stray `Assem` is closed | | 28 | Restricted VBA source: `SOLIDWORKS_MCP_ALLOW_VBA_SOURCE` = off / restricted / full; `restricted` checks the source against the SolidWorks type library and a blocklist before it runs, with every default and option disclosed in the docs (the user's choice 2026-11-17) | none | `vba-source-restricted` (archived) | Done 2026-11-17 (#248), checked live: restricted source runs, a `Shell` line is refused, `off` refuses | -| 29 | Equations and global variables: `list_equations`, `set_equation` (add or change, in all configurations by default) and `delete_equation`, so one value drives several dimensions. The base for macro-driven parametric features | none | `equations-and-global-variables` | Done 2026-11-18 (#250): all three live tests passed; the wrench demo recorded. Archive after the user signs off the two small demos (task 4.4) | +| 29 | Equations and global variables: `list_equations`, `set_equation` (add or change, in all configurations by default) and `delete_equation`, so one value drives several dimensions. The base for macro-driven parametric features | none | `equations-and-global-variables` (archived) | Done 2026-11-18 (#250): all three live tests passed; the wrench demo recorded. The two small demos signed off and archived 2026-12-01 | | 30 | Build a part from an engineering drawing (image or PDF): research first, then an OpenSpec change for a first version | #249 | not yet written | Research to do (the user's request 2026-11-17) | -| 31 | `generate_drawing_package` fits every title-block field the sheet format fills from a property, not just DWG NO. and TITLE | #158 (part) | `title-block-fit-every-field` | Done 2026-11-19 (#251), checked live | +| 31 | `generate_drawing_package` fits every title-block field the sheet format fills from a property, not just DWG NO. and TITLE | #158 (part) | `title-block-fit-every-field` (archived) | Done 2026-11-19 (#251), checked live; the user's rerun passed and archived 2026-12-01 | | 32 | Sketch essentials: sketch fillet and chamfer, slots, trim and extend, tangent and 3-point arcs, centre rectangle, construction geometry on and off (ISketchManager; the user's choice 2026-11-19, first of the COM-coverage packages) | none | `sketch-essentials` (archived) | Done 2026-11-19 (#253): six tools, live demo passed | | 33 | Assembly depth and a ballooned drawing: exploded view, component patterns, mirror and replace components, hide/show/transparency, `AutoBalloon` on the drawing | #23 (part) | `assembly-depth` | Done (#260, archived 2026-11-22) | | 34 | Helix and swept cuts: helix/spiral, a swept cut (`create_sweep` only adds material), thicken; springs and modelled threads | none | `helix-and-swept-cuts` | Built 2026-11-25: `create_helix`, `create_cut_sweep`, named and circular sweep profiles, both sweeps measured. Live demos passed 2026-11-26; beta for now (the user's choice) | | 35 | Multi-body tools: combine (add, subtract, common), split, move/copy, delete/keep a body, scale | none | `multi-body-tools` | Done 2026-11-27: six tools, beta; the user ran the three demos (boolean logic on a cube and a sphere, split and keep, copies and scale) | -| 36 | Appearance and colour: set a part's, body's or face's colour and read it back | none | `appearance-and-reference-tools` | Built 2026-11-28 with item 39: `set_appearance`, `get_appearance`; live tests pass; beta until the user's demo | -| 37 | Drawing sheets and callouts: new and active sheet, auxiliary, break and broken-out views, hole callouts, ordinate dimensions, surface finish, revision table | #158 (part) | `drawing-sheets` (sheets only) | Sheets built 2026-11-28: `list_sheets`, `add_sheet`, `activate_sheet`; live test passes; beta until the user's demo. Callouts, auxiliary, break and broken-out views, ordinate dimensions, surface finish and the revision table are left | +| 36 | Appearance and colour: set a part's, body's or face's colour and read it back | none | `appearance-and-reference-tools` (archived) | Done 2026-11-30 (#284) with item 39: `set_appearance`, `get_appearance`; demo signed off; archived 2026-12-01 | +| 37 | Drawing sheets and callouts: new and active sheet, auxiliary, break and broken-out views, hole callouts, ordinate dimensions, surface finish, revision table | #158 (part) | `drawing-sheets` (sheets only, archived) | Sheets done 2026-12-01 (#286): `list_sheets`, `add_sheet`, `activate_sheet`; demo signed off; a first view keeps the sheet's scale (#287, `drawing-view-keeps-sheet-scale`, archived). Callouts, auxiliary, break and broken-out views, ordinate dimensions, surface finish and the revision table are left | | 38 | Weldments: structural members, trim/extend, end caps, gussets, cut list | none | not yet written | Planned (needs live probes: the profile library location varies) | -| 39 | Reference and analysis extras: coordinate system, bounding box, centre-of-mass point, section properties; wrap (text on a curved face) | none | `appearance-and-reference-tools` | Built 2026-11-28 except wrap: `create_coordinate_system` (model axes only; SolidWorks ignores the flips with no axis selected), `create_center_of_mass_point`, `create_bounding_box`, `get_section_properties`; live tests pass; beta until the user's demo. Wrap and turned axes are left | +| 39 | Reference and analysis extras: coordinate system, bounding box, centre-of-mass point, section properties; wrap (text on a curved face) | none | `appearance-and-reference-tools` (archived) | Done 2026-11-30 (#284) except wrap: `create_coordinate_system` (model axes only; SolidWorks ignores the flips with no axis selected), `create_center_of_mass_point`, `create_bounding_box`, `get_section_properties`; demo signed off. Wrap and turned axes are left | | 40 | Structure review (the user's request 2026-11-19), not a rewrite: the adapter wrappers (`base`, `circuit_breaker`, `connection_pool`, each about 2,500 lines of near-identical per-tool methods) repeat every adapter method, and the largest modules (`mock_adapter` 4,900, `io` 4,000, `features` 3,800, `modeling` 3,200, `sketch` 2,900 lines) should split by topic, as `adapters/solidworks/` already does. Measure the repetition, propose a SOLID structure (one generic forwarding path; one module per topic), and move to it in steps that keep every test passing. Widened 2026-11-25 (the user's request): also audit every function for full type hints, Google-style docstrings with every section (Args, Returns, Raises, and an Example where the use isn't obvious), and inline comments that explain the logic, so each function's job is obvious; and the code sprawl: files and helpers that have grown in miscellaneous places, and a layout that scales to more tools and features (where a new tool's adapter method, wrapper, mock, schema and tests go). Its own PR, separate from feature work | none | not yet written | Planned (last) | | 41 | Test in other SolidWorks languages: find how to switch SolidWorks' language on this machine (System Options > General > "Use English language", language packs from the Installation Manager, the registry), what that changes (UI, default template names, feature and sketch point names such as `Point1`, standard view names, `GetModelViewNames` order) and run the default-entity and selftest live tests in German and French. Prompted by #262: 2.2.0's language handling was only tested on English SolidWorks with renamed planes | #262 (follow-up) | not yet written | Planned | | 42 | U-joint replay differences: decide, call by call, whether each of the nine calls that end differently on today's server is variance in a long agent run or something to fix on our end (a clearer error, a better description, or accepting `axis_entity: "centerline"` when the sketch has one centreline); rerun the prompt on today's server and compare | #278 | not yet written | Planned | -| 43 | Modelled threads (the user's request 2026-11-26): external (male) and internal (female) threads through SolidWorks' Thread feature (`IThreadFeatureData`, the installed die and tap profiles), at standard sizes with coarse and fine pitches read from the installed Hole Wizard tables (`

_DATA_HW_TappedHole`), the thread depth reported from the ISO 68-1 profile, and a thread runout (DIN 76 / ISO 4755). Research notes: `openspec/research/modelled-threads.md` | none | `modelled-threads` | Built 2026-11-28: `list_thread_sizes`, `create_thread` (die and tap profiles, coarse or fine, ISO 68-1 depth, ISO 3508 runout reported); live tests pass; beta until the user's demo. Runout as geometry and M1/M1.4 are open questions | +| 43 | Modelled threads (the user's request 2026-11-26): external (male) and internal (female) threads through SolidWorks' Thread feature (`IThreadFeatureData`, the installed die and tap profiles), at standard sizes with coarse and fine pitches read from the installed Hole Wizard tables (`

_DATA_HW_TappedHole`), the thread depth reported from the ISO 68-1 profile, and a thread runout (DIN 76 / ISO 4755). Research notes: `openspec/research/modelled-threads.md` | none | `modelled-threads` (archived) | Done 2026-11-30 (#285): `list_thread_sizes`, `create_thread` (die and tap profiles, coarse or fine, ISO 68-1 depth, a bolt-like start, `lead_in`, and a `fade` or DIN 76-1 `undercut_a` runout); demos signed off; archived 2026-12-01. M1/M1.4 is an open question | ## Removed tools (item 10, release 2.1.0) diff --git a/openspec/specs/tools/appearance/spec.md b/openspec/specs/tools/appearance/spec.md new file mode 100644 index 00000000..417d8d9a --- /dev/null +++ b/openspec/specs/tools/appearance/spec.md @@ -0,0 +1,56 @@ +# tools/appearance Specification + +## Purpose +TBD - created by archiving change appearance-and-reference-tools. Update Purpose after archive. +## Requirements +### Requirement: Colour the part, a feature, a body or a face +`set_appearance` SHALL take a `color`, either `[r, g, b]` with each value 0 +to 255 or a `#rrggbb` string, and an optional `transparency` from 0 (opaque, +the default) to 1. It SHALL colour exactly one target: the whole part when +no target is given, or the feature named by `feature`, the body named by +`body` (as `list_bodies` names it), or the face at `face_point` (`[x, y, z]` +mm, a point on the face). The reply SHALL read the colour back from +SolidWorks and give it as `color` `[r, g, b]` (0-255), `hex` and +`transparency`, with `target` saying what was coloured. + +A face's colour shows over its feature's, and a feature's over the part's +(checked live, SolidWorks 2026). + +#### Scenario: A blue top face on a green block +- **WHEN** a 40 × 40 × 10 mm block's feature `Boss-Extrude1` is set to + `#1fcc33` and the face at `[0, 10, 0]` to `[25, 76, 242]` +- **THEN** both calls succeed, each reply reads back the colour asked for + (to the nearest 1/255), and the top face shows blue over the green sides + +#### Scenario: Two targets at once +- **WHEN** `set_appearance` is given both `feature` and `face_point` +- **THEN** it fails with `invalid_input`, saying to give one target + +#### Scenario: A target that doesn't exist +- **WHEN** `feature` names no feature, `body` no body, or `face_point` + lies on no face +- **THEN** it fails with `invalid_input`; for a body the message lists the + bodies there are + +### Requirement: Remove a colour +`set_appearance` with `reset: true` and a `feature`, `body` or `face_point` +SHALL remove that target's own colour so the colour above it shows again, +and SHALL reply `color` null for it. `reset` on the whole part SHALL fail +with `invalid_input`: the part's colour is the base, not an override. + +#### Scenario: A face back to its feature's colour +- **WHEN** a coloured face is reset +- **THEN** the call succeeds and `get_appearance` on that face reports the + feature's colour, from `level` "feature" + +### Requirement: Read a colour back +`get_appearance` SHALL take the same targets (none for the part) and reply +`color`, `hex`, `transparency` and `level`: the level the visible colour +comes from (`face`, `body`, `feature` or `part`), walking up from the +target until one has a colour of its own. + +#### Scenario: An uncoloured face of a coloured feature +- **WHEN** only `Boss-Extrude1` is coloured and a side face is read +- **THEN** `get_appearance` gives the feature's colour with `level` + "feature" + diff --git a/openspec/specs/tools/drawing-package-title-block/spec.md b/openspec/specs/tools/drawing-package-title-block/spec.md new file mode 100644 index 00000000..11c39c1f --- /dev/null +++ b/openspec/specs/tools/drawing-package-title-block/spec.md @@ -0,0 +1,45 @@ +# tools/drawing-package-title-block Specification + +## Purpose +The drawing `generate_drawing_package` builds has a title block whose +fields each fit their box, whatever the values' lengths. +## Requirements +### Requirement: Every linked field fits its box +The title-block step SHALL fit every sheet-format note linked to a property +(`$PRP:"name"` or `$PRPSHEET:"name"`): its text SHALL be shrunk until it +ends before the next note in its row (or the title block's right edge), +no smaller than the minimum height, and no larger than +`title_block_text_height_mm` when that is given. A property shown by more +than one note SHALL be fitted once, by its first note. + +#### Scenario: A long material name +- **WHEN** the part's material name is longer than its cell +- **THEN** the reply's `title_block` has an entry for it with `fits` true, + and its text height is below the format's + +#### Scenario: A short value +- **WHEN** a field's value already fits +- **THEN** its entry has `fits` true and the same height before and after + +### Requirement: Each fitted field is named in the reply +The reply's `title_block` SHALL name the DWG NO. `drawing number` and the +TITLE `title`; the drawing's own fields SHALL use the names +`update_title_block` takes, with spaces (`drawn by`, `drawn date`, +`revision`, `company`); any other field SHALL be named by its property. + +#### Scenario: The ISO A3 format +- **WHEN** a drawing is generated on `a3 - iso` +- **THEN** `title_block` lists `drawing number` and `title`, and an entry + for each other property the format links + +### Requirement: The subtitle is the TITLE's second line +A `subtitle` SHALL be shown as a second line of the TITLE field (ISO 7200's +supplementary title), with the TITLE's text height at most 60% of the +format's (or the caller's cap, if smaller). The company field SHALL show +`company` only. + +#### Scenario: A subtitle and no company +- **WHEN** `subtitle` is `Base support` and `company` is empty +- **THEN** the TITLE reads `Package Block` then `Base support`, and the + company field is empty + diff --git a/openspec/specs/tools/drawing-sheets/spec.md b/openspec/specs/tools/drawing-sheets/spec.md new file mode 100644 index 00000000..7c1183f6 --- /dev/null +++ b/openspec/specs/tools/drawing-sheets/spec.md @@ -0,0 +1,43 @@ +# tools/drawing-sheets Specification + +## Purpose +TBD - created by archiving change drawing-sheets. Update Purpose after archive. +## Requirements +### Requirement: The drawing's sheets +`list_sheets` SHALL list the active drawing's sheets in order, each with +`name`, `active`, `paper_mm` (`[width, height]`), `scale` (`"1:2"`) and +`projection` (`first` or `third`), read without changing the active sheet, +with `count` and `active`. It SHALL fail when the active document is not a +drawing. + +#### Scenario: A new drawing +- **WHEN** it is called on a new drawing +- **THEN** it lists `Sheet1`, active, with its paper size and scale + +### Requirement: A new sheet +`add_sheet` SHALL add a sheet named `name` with the format `sheet_format` +(a name found in SolidWorks's sheet format folders or a `.slddrt` path), +the paper size (from the format's name unless given), `scale` and +`projection` (the active sheet's unless given), make it active, and reply +with `added`, `sheet_format` and the listing after. A name in use (ignoring +case), an unknown format, a bad scale or projection SHALL fail with +`invalid_input`, changing nothing. + +#### Scenario: A details sheet +- **WHEN** it is called with `name` "Details", `sheet_format` "a2 - iso" + and `scale` "1:2" +- **THEN** the listing has Details, active, 594 x 420 mm, at 1:2 + +#### Scenario: A name in use +- **WHEN** it is called with `name` "sheet1" on a drawing with Sheet1 +- **THEN** it fails with `invalid_input`, listing the sheets + +### Requirement: The active sheet +`activate_sheet` SHALL make the sheet named `name` (ignoring case) the +active one and reply with the listing after. An unknown name SHALL fail +with `invalid_input`, listing the sheets. + +#### Scenario: Back to the first sheet +- **WHEN** it is called with "SHEET1" while Details is active +- **THEN** Sheet1 is active + diff --git a/openspec/specs/tools/drawing-view-placement/spec.md b/openspec/specs/tools/drawing-view-placement/spec.md new file mode 100644 index 00000000..c2a15bdb --- /dev/null +++ b/openspec/specs/tools/drawing-view-placement/spec.md @@ -0,0 +1,25 @@ +# tools/drawing-view-placement Specification + +## Purpose +TBD - created by archiving change drawing-view-keeps-sheet-scale. Update Purpose after archive. +## Requirements +### Requirement: A placed view keeps the sheet's scale +`create_drawing_view` SHALL leave the active sheet's scale as it was before +the view was placed, setting it back when SolidWorks rescaled the sheet, and +SHALL reply with `sheet_scale` (e.g. `"1:2"`), `sheet_rescale_undone` (the +scale SolidWorks had chosen, or null when it chose none) and `fits_sheet` +(whether the view's outline lies on the paper, or null when unread). With +`fit_sheet_scale` true it SHALL keep the scale SolidWorks chose. It SHALL NOT +change SolidWorks's own options. + +#### Scenario: A first view on a 1:2 sheet +- **WHEN** a front view of a 30 mm block is placed on an empty sheet at 1:2 + while SolidWorks's automatic view scaling is on +- **THEN** the sheet reads 1:2 afterwards, `sheet_rescale_undone` names the + scale SolidWorks had chosen, and `fits_sheet` is true + +#### Scenario: Letting SolidWorks fit the sheet +- **WHEN** the same view is placed with `fit_sheet_scale` true +- **THEN** the sheet keeps the scale SolidWorks chose and + `sheet_rescale_undone` is null + diff --git a/openspec/specs/tools/equations/spec.md b/openspec/specs/tools/equations/spec.md new file mode 100644 index 00000000..87df3849 --- /dev/null +++ b/openspec/specs/tools/equations/spec.md @@ -0,0 +1,68 @@ +# tools/equations Specification + +## Purpose +An agent reads, adds, changes and deletes the equations and global +variables of the active part or assembly, so one value can drive several +dimensions and the model stays consistent when it changes. +## Requirements +### Requirement: List equations +`list_equations` SHALL return every equation of the active part or +assembly in SolidWorks' order, each with `index`, `name` (the left-hand +side without quotes), `expression` (the right-hand side), `kind` +(`global_variable`, `dimension` or `other`) and `value` (the solved value +SolidWorks reports, or null when it has none). A model with no equations +SHALL give an empty list, not an error. + +#### Scenario: A part with a global variable driving a dimension +- **WHEN** the part has `"Width" = 60mm` and `"D1@Sketch1" = "Width" / 2` +- **THEN** the reply lists `Width` as a `global_variable` with value 60 + and `D1@Sketch1` as a `dimension` with value 30 + +#### Scenario: No equations +- **WHEN** the part has none +- **THEN** the reply has an empty `equations` list and status `success` + +### Requirement: Add or change an equation +`set_equation` SHALL take `name` and `expression`, and `configurations` +(`all` by default, `this`, or a list of names). A `name` with an `@` is a +dimension and SHALL be one the model has; any other name is a global +variable. When an equation for `name` exists (names compared without +regard to case) its expression SHALL be replaced; otherwise one SHALL be +added. The model SHALL be solved and rebuilt, and the reply SHALL give +the equation as SolidWorks stored it, its value, and whether it was +`added` or `changed`. + +#### Scenario: A global variable drives a dimension +- **WHEN** `set_equation` is called with `Width` = `60mm`, then with + `D1@Sketch1` = `"Width" / 2` +- **THEN** the sketch dimension reads 30 mm, and setting `Width` to `80mm` + makes it read 40 mm + +#### Scenario: An expression SolidWorks refuses +- **WHEN** `expression` is `"NoSuchVariable" * 2` +- **THEN** the call fails with `equation_refused`, and `list_equations` + is unchanged + +#### Scenario: A dimension the model doesn't have +- **WHEN** `name` is `D9@NoSuchSketch` +- **THEN** the call fails with `invalid_input` pointing to + `list_model_dimensions`, and nothing is added + +#### Scenario: One configuration only +- **WHEN** `configurations` is `["Long"]` and the part has `Default` and + `Long` +- **THEN** the value applies in `Long`, and `Default` keeps its own + +### Requirement: Delete an equation +`delete_equation` SHALL take `name`, remove that equation, and reply with +the names left. A dimension it drove SHALL keep its last value. + +#### Scenario: Deleting a driving equation +- **WHEN** `D1@Sketch1` = `"Width" / 2` is deleted +- **THEN** `list_equations` no longer lists it and the dimension still + reads its last value + +#### Scenario: An unknown name +- **WHEN** no equation is named `name` +- **THEN** the call fails with `invalid_input` listing the equation names + diff --git a/openspec/specs/tools/reference-extras/spec.md b/openspec/specs/tools/reference-extras/spec.md new file mode 100644 index 00000000..7dcbee1e --- /dev/null +++ b/openspec/specs/tools/reference-extras/spec.md @@ -0,0 +1,58 @@ +# tools/reference-extras Specification + +## Purpose +TBD - created by archiving change appearance-and-reference-tools. Update Purpose after archive. +## Requirements +### Requirement: A coordinate system at a point +`create_coordinate_system` SHALL take `origin` (`[x, y, z]` mm) and SHALL +insert a coordinate system there with its axes along the model's. The origin is a +point in a 3D sketch the tool draws for it. The reply SHALL give the +feature's `name` and read its transform back as `origin_mm` and the three +axis directions `x_axis`, `y_axis` and `z_axis`. + +#### Scenario: At a corner of a block +- **WHEN** it is called with `origin` `[20, 10, 20]` on a 40 × 40 × 10 mm + block +- **THEN** it replies `name` "Coordinate System1", `origin_mm` + `[20, 10, 20]` and `x_axis` `[1, 0, 0]` + +#### Scenario: No turning yet +- **WHEN** a caller wants turned or reversed axes +- **THEN** the tool has no input for it: SolidWorks ignores the flip flags + when no axis is selected (checked live), so turned axes wait for axis + lines drawn and selected (a later change) + +### Requirement: The centre-of-mass point +`create_center_of_mass_point` SHALL insert SolidWorks's Center of Mass +reference point on the active part and reply with its `name` and +`center_of_mass_mm`. A part that has one already, or has no solid body, +SHALL fail with `invalid_input` saying so. + +#### Scenario: A block 10 mm tall on the Top Plane +- **WHEN** it is called on a 40 × 40 × 10 mm block +- **THEN** `center_of_mass_mm` is `[0, 5, 0]` + +### Requirement: The bounding box +`create_bounding_box` SHALL insert SolidWorks's Bounding Box feature around +the part's solid bodies (best fit), optionally including hidden bodies, and +reply with its `name` and the box's `size_mm` `[x, y, z]`, read from +SolidWorks. + +#### Scenario: A block +- **WHEN** it is called on a 40 × 40 × 10 mm block +- **THEN** `size_mm` holds 40, 10 and 40 (in model axes) + +### Requirement: Section properties of a planar face +`get_section_properties` SHALL take `face_point` (`[x, y, z]` mm on a planar +face) and reply with the face's `area_mm2`, `centroid_mm`, the second +moments of area about the centroid in model axes (`ixx`, `iyy`, `izz`, +`ixy`, `izx`, `iyz`, mm⁴), `polar_moment_mm4` and the principal moments +`principal_moments_mm4`. It changes nothing in the model. A point on no +face, or on a face SolidWorks can't take a section of, SHALL fail with +`invalid_input`. + +#### Scenario: A 40 mm square face +- **WHEN** it is given the top face of a 40 × 40 × 10 mm block +- **THEN** `area_mm2` is 1600, `centroid_mm` is `[0, 10, 0]`, and `ixx` and + `izz` are 40⁴/12 = 213,333.3 mm⁴ + diff --git a/openspec/specs/tools/sketch-text/spec.md b/openspec/specs/tools/sketch-text/spec.md new file mode 100644 index 00000000..2dca7dce --- /dev/null +++ b/openspec/specs/tools/sketch-text/spec.md @@ -0,0 +1,71 @@ +# tools/sketch-text Specification + +## Purpose +An agent writes text in a sketch, at a point or centred on one, at a +chosen letter height, so a cut or an extrusion can deboss or emboss it. +The text may show a custom property (`$PRP:"name"`); a property linked to +a dimension makes the text follow that dimension, and so an equation. +## Requirements +### Requirement: Text in the open sketch +`add_sketch_text` SHALL add `text` to the open sketch starting at `x`, +`y` (mm, sketch coordinates), its letters `height` millimetres tall +(default 3.5) and spaced normally, and reply with the text's `id`, the +text SolidWorks shows (a `$PRP:` link resolved) and the height. It SHALL +fail with `invalid_input` for empty text, a height that isn't positive or +a `center_at` that isn't three numbers, and with an error when no sketch +is open. + +#### Scenario: A word on a bar's top face +- **WHEN** a sketch is open on a 120 x 30 x 4 mm bar's top face and + `add_sketch_text` is called with `text` `solidworksmcp` and `height` 4 +- **THEN** the reply gives the text's `id`, `solidworksmcp` and height 4, + and a 0.3 mm cut from that sketch removes material from the bar + +### Requirement: Text centred on a model point +Given `center_at`, a model point `[x, y, z]` in mm, `add_sketch_text` +SHALL move the text so the middle of its extent lies on that point +projected onto the sketch. + +#### Scenario: The middle of a bar +- **WHEN** the bar runs from x = 0 to 120 and `center_at` is `[60, 2, 0]` + on its top face +- **THEN** the text's middle is at x = 60 mm, across the bar's middle + +#### Scenario: Read from the underside +- **WHEN** the sketch is opened on the bar's bottom face (`face_point`) + and the text centred at `[60, -2, 0]` +- **THEN** seen from below the text reads left to right, centred + +### Requirement: A linked property shows its dimension when written +Text containing `$PRP:"name"`, where the custom property `name` holds a +dimension's name in quotes (`"D1@Sketch3"`), SHALL show that dimension's +value at the moment the text is written. SolidWorks doesn't redraw sketch +text when the model rebuilds, so the text keeps that value until it is +written again (`set_sketch_text`). + +#### Scenario: Written at 13 mm +- **WHEN** the text is `size $PRP:"WrenchSize" mm` and `WrenchSize` is + `"D1@Sketch3"`, which is 13 mm +- **THEN** the text reads `size 13.00 mm`, and still does after an + equation changes `D1@Sketch3` to 19 mm and the model rebuilds + +### Requirement: Re-letter a sketch's text +`set_sketch_text` SHALL replace the text of every sketch text in the +named sketch with `text`, with the sketch open for editing (the only way +SolidWorks redraws it), close the sketch, rebuild, and reply with the +sketch and each text's string before and after (links read when +asked, so `before` can already hold a new value the lettering doesn't +show yet). A sketch that doesn't exist, or has no text, SHALL fail and +change nothing. + +#### Scenario: The size changed +- **WHEN** the lettering above is in `Sketch12`, `D1@Sketch3` is now 19 mm, + and `set_sketch_text` is called with `Sketch12` and the same + `size $PRP:"WrenchSize" mm` +- **THEN** the reply's `after` is `size 19.00 mm`, and the cut from that + sketch reads 19.00 + +#### Scenario: No such sketch +- **WHEN** `set_sketch_text` is called with `Sketch99` +- **THEN** it fails as not found and nothing changes + diff --git a/openspec/specs/tools/threads/spec.md b/openspec/specs/tools/threads/spec.md new file mode 100644 index 00000000..c7cb91d6 --- /dev/null +++ b/openspec/specs/tools/threads/spec.md @@ -0,0 +1,136 @@ +# tools/threads Specification + +## Purpose +TBD - created by archiving change modelled-threads. Update Purpose after archive. +## Requirements +### Requirement: The standard sizes SolidWorks holds +`list_thread_sizes` SHALL take `standard` (`metric` or `inch`) and list the +sizes of SolidWorks's own Die thread profile for it, read from the Thread +Profiles folder SolidWorks names. Each entry SHALL give `size` (the name +`create_thread` takes, e.g. `M6x1.0` or `1/4-20`), `diameter_mm`, +`pitch_mm` (and `tpi` for inch), `pitch_class` (`coarse` for the coarsest +pitch listed at that diameter when there are several, `fine` for the +others, `only` when there is one), `basic_depth_mm` (ISO 68-1: 5/8 of the +fundamental triangle, 0.541266 × P) and `runout_mm` with its normal (2.5P) +and short (1.25P) values (ISO 3508). The reply SHALL say where the runout +rule comes from (`runout_basis`): ISO 3508 for metric, the ISO 3508 rule on +the inch pitch (1/TPI) for inch. + +#### Scenario: Metric sizes +- **WHEN** it is called with `standard` `metric` +- **THEN** `M6x1.0` is listed with `pitch_mm` 1.0, `pitch_class` `coarse` + and `runout_mm` normal 2.5 and short 1.25, and `M10x1.25` with + `pitch_class` `fine` + +### Requirement: A modelled thread +`create_thread` SHALL take `kind` (`external` or `internal`), `standard`, +`size`, `edge_point` (`[x, y, z]` mm on the circular edge where the thread +starts), `length` (mm) and `hand` (`right`, the default, or `left`), and +SHALL make SolidWorks's Thread feature with the Die profile for an external +thread or the Tap profile for an internal one, cutting the thread. The +reply SHALL give the feature's `name`, the size, its pitch and depth, the +runout, and the volume before, after and removed. + +The thread SHALL start two pitches outside the part, the way a die or tap +starts in the air, so its groove runs out through the end face (or the +hole's opening) instead of starting in a flat-ended pocket there; `length` +SHALL still be the full thread's length measured from the edge. + +#### Scenario: An M6 external thread +- **WHEN** a 6 mm rod's top edge is picked and `create_thread` is called + with `kind` external, `size` `M6x1.0` and `length` 12 +- **THEN** a Thread feature is made, the part loses volume, and the reply + gives `pitch_mm` 1.0 and `runout_mm` 2.5 + +#### Scenario: The groove runs out through the end face +- **WHEN** an M6x1.0 thread is cut 12 mm from a rod's top edge +- **THEN** the Thread feature is offset 2 mm (two pitches) out past the + edge, with its length kept, so the full thread still ends 12 mm from + the end face + +### Requirement: Refused before anything is built +`create_thread` SHALL fail with `invalid_input`, changing nothing, when the +size isn't one the profile holds (the message names the nearest sizes), +the point is on no edge or on one that isn't circular, or the edge's +diameter doesn't suit the size: an external thread's cylinder within one +pitch of the nominal diameter, an internal thread's hole within one pitch +of the tap drill (nominal minus one pitch). + +#### Scenario: The wrong size for the rod +- **WHEN** `M10x1.5` is asked for on a 6 mm rod +- **THEN** it fails with `invalid_input`, saying the edge is 6 mm and the + size wants about 10 mm + +### Requirement: A thread that cuts nothing is undone +A Thread feature that leaves the volume unchanged, or adds material, SHALL +be deleted and the call SHALL fail with `feature_not_built`. + +#### Scenario: Nothing cut +- **WHEN** SolidWorks makes the feature but the volume is unchanged +- **THEN** the feature is deleted and the call fails + +### Requirement: The thread's runout, modelled +`create_thread` SHALL take `runout`: `none` (the default), `fade`, +`undercut_a` or `undercut_b`. With `fade` on an external thread the +Thread feature's end face SHALL be swept as a cut straight along the +helix's tangent at the thread's end, out past the rod: the line leaves the +round rod, so the groove gets shallower until it runs out, over +sqrt(r² − (r − h)²) for the rod's radius r and the basic depth h (M6: +1.72 mm). On an internal thread a straight line would run into the hole's +wall, so its end face SHALL be swept along an arc tangent to the helix +that turns towards the axis and leaves the material over DIN 76-1's +normal runout x1 (2.5P where the table has no row). With `undercut_a` or `undercut_b` an external +metric thread SHALL end in a DIN 76-1 Form A or Form B undercut: a revolved +groove at the thread's end, of diameter dg, width g2, a 30° flank on the +thread side and the radius r at the shoulder, from DIN 76-1 Table 1 for the +pitch. The reply SHALL give `runout` with the style, its dimensions, the +feature it made and the volume it removed. An undercut on an internal or an +inch thread, a pitch the table has no row for, an undercut wider than the +thread, or an axis that no main plane holds SHALL fail with `invalid_input` +before anything is built. + +#### Scenario: A faded M6 thread +- **WHEN** `create_thread` cuts M6x1.0 12 mm on a 6 mm rod with `runout` + `fade` +- **THEN** the end face is swept straight along the helix's tangent, the + groove fades out over 1.72 mm, and the reply gives `method` `tangent`, + the fade's length and the volume it removed + +#### Scenario: A faded tapped hole +- **WHEN** `create_thread` cuts an internal M6x1.0 with `runout` `fade` +- **THEN** the end face is swept along an arc towards the axis over 2.5 mm + and the reply gives `method` `arc` + +#### Scenario: A DIN 76-1 Form A undercut +- **WHEN** `create_thread` cuts M6x1.0 12 mm with `runout` `undercut_a` +- **THEN** the thread ends in a groove of diameter 4.4 mm and width 3.5 mm + with r 0.5 mm, and the reply gives those dimensions + +#### Scenario: An undercut on a tapped hole +- **WHEN** `create_thread` is asked for an internal thread with `runout` + `undercut_a` +- **THEN** it fails with `invalid_input` and nothing is built + +### Requirement: A lead-in at the thread's start +`create_thread` SHALL take `lead_in` (default false). With it, an external +thread's start SHALL be chamfered the way ISO 4753's chamfered end is: 45° +from the end face down to an end diameter just under the minor diameter +(d3 = d − 1.22687P, ISO 724, rounded down to 0.1 mm), revolved as a cut +after the thread and its runout, so the chamfer is the last feature. The +reply SHALL give `lead_in` with the basis, the end diameter, the chamfer's +length, the features it made and the volume it removed. The runout stays +at the other end, at the shoulder. A lead-in on an internal thread, or on +an axis no main plane holds, SHALL fail with `invalid_input` before +anything is built; if SolidWorks builds no lead-in, the thread and its +runout SHALL be removed too. + +#### Scenario: An M6 bolt that starts in a nut +- **WHEN** `create_thread` cuts M6x1.0 to a collar with `runout` + `undercut_a` and `lead_in` true +- **THEN** the free end is chamfered 45° to 4.7 mm (0.65 mm long) and the + undercut stays at the collar + +#### Scenario: A lead-in in a tapped hole +- **WHEN** `create_thread` is asked for an internal thread with `lead_in` +- **THEN** it fails with `invalid_input` and nothing is built +