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



_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 +