drawing
A dimensioned workshop drawing made from a `solid` model: per part, projected views (front, top, right side, isometric, and an auxiliary view along any slanted hole axis; third angle; hidden edges dashed) and, for an assembly, front and top views with balloons and a parts list (item, part, material, quantity, mass each and total).
Every dimension's end points come from the model's exact B-rep facts (bounding box for overall sizes; a cylindrical face's axis and radius for hole diameters and centre positions; a slanted planar face's normal and edges for an angle), never typed.
The Bench's drafting engine (draft, bench-draft-cli) draws and measures the dimensions (DIMLFAC = 1 / scale, so the text reads true size) and writes DXF, PDF and PNG on A₄ or A₃ at the largest ISO 5455 scale that fits.
Each printed value is read back from the DXF the engine wrote and returned beside the model's value.
Title block: part, material, mass from the model, scale, units, projection, the solid run it was made from (checked against the journal), date.
Input `drawing_file` ("@<solid run>/drawing.json", made with drawing_data: true) and `source_run`, or a `model` script (the solid instrument's own code then runs inside this run).
- Field
- Mechanics, CAD and finite elements
- Version
- 0.1.0
- Runs as
- Compiled (Rust)
- Typical run
- 8 s
Compiled from source: run sh packs/install.sh once before admitting it.
Known answers it must pass
r0001a box 40 × 20 × 10 with one 6 mm hole at (10, 10), forced to 2:1 on A₄: every printed dimension equals the script's parameter (L, W, T, D, X, Y); drawn lengths are twice the model's (the scale arithmetic: printed = drawn x DIMLFAC = drawn / 2); end points lie on the drawn linespassed
dims.plate.front.size_x= 40, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagedims.plate.top.size_x= 40, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagedims.plate.top.size_y= 20, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagedims.plate.right.size_y= 20, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagedims.plate.front.size_z= 10, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagedims.plate.right.size_z= 10, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagedims.plate.top.hole_d.0= 6, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagedims.plate.top.hole_x.0= 10, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagedims.plate.top.hole_y.0= 10, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagedrawn.plate.top.size_x= 80, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagedrawn.plate.top.hole_d.0= 12, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagesheets.plate.scale_factor= 2, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagesheets.plate.dimlfac= 0.5, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagesheets.plate.paper= A₄misseddifferssheets.plate.mass_g= 20.836593, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagescale_check_max_rel≤ 10⁻¹²0lockedinside the rangemax_dim_error≤ 10⁻⁹4.44089 × 10⁻¹⁶lockedinside the rangeanchor_offset_max_mm≤ 0.0020lockedinside the rangen_sheets= 11lockedexact matchr0002the same box with X = 12, Y = 7, D = 5 (parameters changed): the drawing follows, every dimension equals the new parameterpassed
dims.plate.top.hole_d.0= 5, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagedims.plate.top.hole_x.0= 12, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagedims.plate.top.hole_y.0= 7, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagesheets.plate.mass_g= 21.069856, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagemax_dim_error≤ 10⁻⁹2.53765 × 10⁻¹⁶lockedinside the ranger0003a wedge, profile (0,0) (40,0) (40,10) (0,30) extruded 8: its slanted face at atan(20/40) = 26.565051177° to the top view's horizontal; an L profile (legs 5 wide, 30 × 20): edge counts top 6, front 4 + 1 hidden, side 5; overall sizespassed
dims.wedge.top.angle.0= 26.565051, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagedims.wedge.top.size_x= 40, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagedims.wedge.top.size_y= 30, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagedims.wedge.front.size_z= 8, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagedims.ell.top.size_x= 30, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagedims.ell.top.size_y= 20, within 1.000000 × 10⁻⁹ relativereading not recorded on this pageviews.ell.top.n_visible= 6misseddiffersviews.ell.front.n_visible= 4misseddiffersviews.ell.front.n_hidden= 1misseddiffersviews.ell.right.n_visible= 5misseddiffersviews.wedge.top.n_visible= 4misseddiffersmax_dim_error≤ 10⁻⁹6.66134 × 10⁻¹⁶lockedinside the rangeanchor_offset_max_mm≤ 0.0021.42109 × 10⁻¹⁴lockedinside the rangen_sheets= 33lockedexact matchr0004a block 400 × 200 × 100, scale chosen: 1:1 cannot fit A₃ (front 400 + side 200 > 392 mm of frame), 1:2 does (200 + 100 + dimension room); A₄ would need 1:5, so A₃ at 1:2; printed sizes 400, 200, 100 from drawn 200, 100, 50passed
sheets.block.paper= A₃misseddifferssheets.block.scale_factor= 0.5, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagedims.block.front.size_x= 400, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagedims.block.top.size_y= 200, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagedims.block.front.size_z= 100, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagedrawn.block.front.size_x= 200, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagescale_check_max_rel≤ 10⁻¹²0lockedinside the range
Each line is one reading the kernel checked. The bright band is the tolerance; the needle is the value the instrument actually returned when it was admitted. A needle near the centre line used little of its tolerance.
Inputs
| Name | Unit | Default | Meaning |
|---|---|---|---|
drawing_file | drawing.json from a solid run made with drawing_data: true, e.g. "@r0019/drawing.json". | ||
source_run | The solid run drawing_file came from ("r0019"): printed in the title block; checked against the lab's journal (same instrument, same file hash) and refused if it does not match. | ||
model | Instead of drawing_file: a solid model script (see the solid instrument); solid's code runs inside this run with drawing_data on. The title block then says so (no source run). | ||
parameters | {} | With model: overrides of the model's parameters by name. | |
sheets | Which sheets, in order: [{"part": name, "scale"?: "5:1"}, {"assembly": true}]. Default: every part, then the assembly (when it has more than one instance). | ||
paper | auto | auto: A₄ when it takes the same scale as A₃, else A₃ (landscape). | |
scale | auto | "auto" (the largest ISO 5455 scale that fits: 50:1 ... 1:200) or a scale such as "2:1" for every sheet. | |
date | Date for the title block. Default: the date of the source run (so a replay draws the same sheet). | ||
show_parameters | [] | Parameter names whose values the title block prints (e.g. ["strip_L"]). |
Readings
| Name | Unit | Meaning |
|---|---|---|
dims | dims.<sheet>.<view>.<what>: each printed dimension's value (mm or degrees), as the engine measured it x DIMLFAC. <what>: size_x|size_y|size_z, hole_d.<i>, hole_x.<i> (centre from the left edge), hole_y.<i>/hole_z.<i> (from the bottom edge), radius.<i>, angle.<i> | |
drawn | drawn.<sheet>.<view>.<what>: the length on paper (mm; angles in degrees) the engine measured | |
dimensions | every dimension, keyed "<sheet> <view> <what>": sheet, view, kind, what it stands for, model value (from the B-rep), drawn_mm (on paper), printed, text, error, anchor_offset_mm (its end points' distance from the drawn geometry, model mm) | |
max_dim_error | largest |printed - model| / model over all dimensions | |
anchor_offset_max_mm | mm | largest distance of a dimension end point from the drawn geometry (curved edges are drawn as chords within 0.001 mm) |
scale_check_max_rel | largest |drawn / printed - scale| / scale over the linear dimensions | |
sheets | per sheet: paper, scale, scale_factor, dimlfac, views drawn and skipped, mass_g, the pdf, png and dxf, the scales tried | |
views | views.<sheet>.<view>.{n_visible, n_hidden}: edges in each projection, as solid counted them | |
NN_<sheet>.pdf | ||
NN_<sheet>.dxf | ||
NN_<sheet>.png |
Try the call
Change a value and the command updates. Nothing runs here; paste it into your terminal or give it to your agent.