Mechanical: Draw Part
mech_part_drawDraws a turned or plate part from validated typed features as dimensioned views, storing the model as XDATA so later section views and inspection need no re-describing.
Instructions
One part model - a turned profile or a plate outline plus typed features - drawn as views.
The model is written onto the drawing as ACADMCP_MECH XDATA on an anchor
POINT, so mech_view_add can add a section months later without the caller
re-describing the part, and mech_part_inspect reads it back.
Refused before anything is drawn, by path: a non-finite or non-positive
number (segments[2].d_outer), a bore that is not smaller than its outside,
an outline with fewer than three distinct vertices or one that crosses
itself, an unknown material, a feature whose placement is off the part, two
features that would remove the same material (both names given), a thread
outside the transcribed ISO 261 table, a keyway outside DIN 6885's bore
range, gear teeth whose tip diameter disagrees with their segment. A DIN 509
undercut, a DIN 471/472 groove, a DIN 332 centre hole and an ISO 3601-2
O-ring groove need explicit dimensions in this build: those tables are not
transcribed and the lookup refuses by name rather than interpolate. A
feature that cannot be projected into a requested view is listed in
omitted, never dropped.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| at_x | No | WCS X of the first view's lower-left corner (the rotation pivot) | |
| at_y | No | WCS Y of the first view's lower-left corner (the rotation pivot) | |
| spec | Yes | The part: {kind: 'revolved'|'prismatic', name, material, segments:[{length, d_outer, d_inner, taper_to}] | outline:[[x,y]] + thickness, features:[{kind, id, ...}]} | |
| style | No | Axial dimension style: chain | baseline | ordinate | chain |
| views | No | Views to draw in order: front | side | top (default ['front']) | |
| rotation | No | Degrees CCW; turns every view and its dimensions about (at_x, at_y) | |
| dimension | No | Also dimension the part (ISO 129 + ISO 286 fits) | |
| projection | No | first (ISO 128-30, default) | third | first |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||