feat(task-7): SECTION 21 - the mechanical part model as six tools
engineering/mech/draw.py is the only module in the package that touches a backend: it turns the pure engine's primitive descriptions into entity_create_* and dimension_* calls, places them in WCS, and writes the part model back onto the drawing as ACADMCP_MECH XDATA on an anchor POINT. It is not a contract member and neither are the tools - exactly like gear_draw_* and titleblock_apply_iso_a3, it composes the generic members, so it is written once and works on both engines by construction and no capability key is needed. No new ActiveX call was written, so there was nothing to probe on the live seat; measured instead that every one of the 23 backend members draw.py calls exists on ComBackend and that ComBackend has no abstract methods left. mech_part_draw takes one model - a turned profile or a plate outline plus typed features - and draws its views in first-angle positions (third on request), dimensions them and records the placement. mech_view_add reads the model back out of the drawing and adds a side, top, section (full/half/offset/revolved) or detail view months later without the caller re-describing the part. mech_dimension_part lays out ISO 129 dimensions with no overlapping text, resolves ISO 286 fits against the measured nominal, and moves the holes into a table past a threshold. mech_hole_pattern exposes the same expansion for a drawing that was never built from the model - with its own diameter guard, because Hole.validate needs a part and a standalone pattern has none. mech_part_inspect reads the payload back and never modifies the drawing. mech_part_from_spec draws a whole sheet inside one transaction. Every part is validated before the transaction opens, so a refusal leaves the drawing untouched and names the path (parts[1]: segments[0].d_outer: ...), and the rollback is shielded with the shape engineering/pid/spec.py documents: anyio cancellation is level-triggered, so a bare await in the handler would be cancelled before the rollback body ran and leave half a sheet inside an open transaction. fits goes through dimension_intents(fits=...), the API Task 6 shipped, rather than being stamped on at draw time: that is the path that validates a key by name and refuses a fit on a reference dimension or on a hole that moved into the table. It is scoped per view first - a fit on segment[0] names nothing in the end view, and refusing there would make a correct three-view sheet undrawable - and any key no view claimed is handed back to dimension_intents so the refusal is written in its own vocabulary. SECTION 21 registers the six tools in the new mech pack, with alias records (SECTIONPLANE, ARRAY plus shop-floor synonyms in English and Turkish - mil, kademeli mil, kama, pah, kesit, gorunus), a regenerated tool inventory, the README release snapshot at 210 tools in 24 groups, and the frozen group-size snapshot gaining mech: 6. Lean is deliberately untouched here: spec section 11 puts three of these on the lean surface together with group G's two sheet tools, and Task 15 makes that edit once across all four branches. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FKFStjEFzpGyLq5bMpWxTd
This commit is contained in:
co-authored by
Claude Opus 5
parent
bd73b3a854
commit
8b14d4ef8d
@@ -3,10 +3,10 @@
|
||||
"schema_version": 1,
|
||||
"package_version": "1.5.1",
|
||||
"totals": {
|
||||
"tools": 204,
|
||||
"tools": 210,
|
||||
"resources": 8,
|
||||
"prompts": 5,
|
||||
"groups": 23
|
||||
"groups": 24
|
||||
},
|
||||
"groups": {
|
||||
"analysis": 12,
|
||||
@@ -22,6 +22,7 @@
|
||||
"environment": 22,
|
||||
"layers": 14,
|
||||
"layouts": 12,
|
||||
"mech": 6,
|
||||
"page_setup": 6,
|
||||
"pid": 9,
|
||||
"premium": 12,
|
||||
@@ -1968,6 +1969,90 @@
|
||||
"readOnlyHint": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "mech_dimension_part",
|
||||
"group": "mech",
|
||||
"cost": "mutate",
|
||||
"summary": "Dimension a drawn part: ISO 129 dimensions, ISO 286 fits, a hole table.",
|
||||
"tags": [
|
||||
"dimension",
|
||||
"mech"
|
||||
],
|
||||
"annotations": {
|
||||
"title": "Mechanical: Dimension Part",
|
||||
"destructiveHint": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "mech_hole_pattern",
|
||||
"group": "mech",
|
||||
"cost": "mutate",
|
||||
"summary": "Draw a linear, grid or polar hole pattern with centre marks on any drawing.",
|
||||
"tags": [
|
||||
"create",
|
||||
"mech"
|
||||
],
|
||||
"annotations": {
|
||||
"title": "Mechanical: Hole Pattern",
|
||||
"destructiveHint": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "mech_part_draw",
|
||||
"group": "mech",
|
||||
"cost": "mutate",
|
||||
"summary": "Draw a machine part from a segment list or an outline plus typed features.",
|
||||
"tags": [
|
||||
"create",
|
||||
"mech"
|
||||
],
|
||||
"annotations": {
|
||||
"title": "Mechanical: Draw Part",
|
||||
"destructiveHint": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "mech_part_from_spec",
|
||||
"group": "mech",
|
||||
"cost": "mutate",
|
||||
"summary": "Draw a whole mechanical sheet - several parts and their views - in one transaction.",
|
||||
"tags": [
|
||||
"create",
|
||||
"mech"
|
||||
],
|
||||
"annotations": {
|
||||
"title": "Mechanical: Sheet From Spec",
|
||||
"destructiveHint": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "mech_part_inspect",
|
||||
"group": "mech",
|
||||
"cost": "read",
|
||||
"summary": "Read the part model back off the drawing: segments, features, views, omissions.",
|
||||
"tags": [
|
||||
"mech",
|
||||
"query"
|
||||
],
|
||||
"annotations": {
|
||||
"title": "Mechanical: Inspect Part",
|
||||
"readOnlyHint": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "mech_view_add",
|
||||
"group": "mech",
|
||||
"cost": "mutate",
|
||||
"summary": "Add another view of a drawn part: side, top, section (full/half/offset) or detail.",
|
||||
"tags": [
|
||||
"create",
|
||||
"mech"
|
||||
],
|
||||
"annotations": {
|
||||
"title": "Mechanical: Add View",
|
||||
"destructiveHint": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "mleaderstyle_create",
|
||||
"group": "styles",
|
||||
|
||||
Reference in New Issue
Block a user