Skip to main content

Module tables

Module tables 

Source
Expand description

Corner-block tables: the spec’s tables (t:<k>, set in the spec), drawn as draftwright’s Sheet.table draws a declared table (revision blocks, BOMs, schedules) through Drawing.add_table and _build_table: row 0 the header, each column as wide as its widest cell’s ink with 2 mm of padding each side (at least 2.5 text heights, as _table_metrics), each cell’s ink centred in its cell, IBM Plex Mono at 3 mm, each row 3 mm plus 2 mm of padding above and below, ruled at every column edge and every row edge.

Each table is reserved when the sheet is chosen, towards its prefer corner (draftwright’s layout_required_tables, which reserves declared tables ahead of the general notes), and placed after the dimensions and the general notes, in the spec’s order, as draftwright places them after the build: by fit_box towards that corner, first with 6 mm of breathing room and then at the text padding, clear of the views’ areas (the isometric’s drawn box), every dimension’s ink, the title block, the notes block and the tables placed before it. A table that fits nowhere is a table_not_placed error naming it (draftwright’s table_dropped), which stays in the plan undrawn.

The pieces the general notes block shares with a table (its text height, padding and row, the font-safe ink, what a block keeps clear of, its placement and its rules) live here; the notes block is draftwright’s single-column table (src/notes.rs).

Structs§

PlacedTable
A table’s place, mm on the page.
PlannedTable
A table the sheet will carry.
RowClaims
TableSpec
A table as the spec states it.

Constants§

CORNERS
The corners a table may prefer, as draftwright names them.
PAD
ROW
One row’s height.
TEXT
The text height and the padding around it, mm (draftwright’s _FONT_SIZE and the draft preset’s pad_around_text).

Functions§

check
The tables are refused, with what to write instead, when an ID is not t:<k>, two tables share an ID, a table has no rows, a row is a string or not a list, the rows are not all of one non-zero length (draftwright’s Sheet.table refusals), a cell is neither a string nor a number, or a corner is not one of CORNERS.
frame_clearance
Half the annotation-rule stroke, shared with measured frame checks.
ink
Legacy font-safe spelling for text-only consumers (draftwright’s _font_safe_text). Drawing and measurement use text_ink so all four callout symbols have ink.
manufacturing
The manufacturing requirements table (draftwright’s _place_manufacturing_schedule): the part’s thread and knurl requirements when their callouts print SEE MFG n (crate::pmi_lowering::manufacturing), drawn as a declared table is, its requirement column left-aligned at the padding (_left_align_cols=(1,)), and placed towards the top right clear of the views, the dimensions, the PMI and the title block, before the general notes and the spec’s tables (draftwright commits it before its other furniture). A table that fits nowhere is a table_not_placed error naming it and the requirements it states, which stays in the plan undrawn; as draftwright then prints the requirements on their callouts in full, the finished drawing is planned again with them in full wording and no table (model::manufacturing_fallback).
manufacturing_size
The size of the manufacturing requirements table of rows (as [measure] sizes a table), or none when there is none: what the sheet reserves for it, top right.
next_id
The first t:<k> after every well-formed ID in ids.
plan
The spec’s tables as Plan items, each placed in the spec’s order clear of the views, the dimensions, the title block, notes (the general notes block’s box) and the tables placed before it, or reported when it has no place.
proxy
The placed table as the blocks placed after it see it: its box as a label.
ruling
A block’s rules, as _build_table rules a table: a vertical at each of columns (its sides among them) and a horizontal at the top and bottom of each row.
sizes
Each table’s size and corner, in the spec’s order: what the sheet reserves for them.
text_ink
A table cell or note on its baseline, preserving prose, punctuation and whitespace. Each callout symbol uses the same one-em cell and ink as dimension labels, even when embedded in a word. Ordinary text retains the font’s advances and line spacing.
texts
Every cell a placed table draws, with its ink centre.