Skip to main content

Module sheets

Module sheets 

Source
Expand description

Drawing sheets — the document’s sheets block, the projection of a placed PMI view into paper millimetres, and the SVG writer.

§The sheets block

{ sheets: [{ id, name, size, widthMm, heightMm, views: [{ id, view, position, scale, projection }] }], idCounter }, a top-level key of the saved document beside pmi and partAttributes. It is ABSENT on every document without a sheet (and omitted on re-serialize), so a part that never had one saves byte-identically. The kernel never sees it: a sheet places what the PMI tail already resolved, so the block rides the document’s unknown-key pass-through (crate::history::History::request_json serializes the raw document) exactly as partAttributes does — no HistoryRequest field, no migration, because it is new.

A sheet is a paper size in millimetres (a preset or a custom pair), the paper’s own FURNITURE — a drawing border inset from the page edge and a title block in its bottom-right corner (frame) — and an ordered list of placed views. A placed view names a saved PMI view by id and adds where it sits on the paper (position, mm from the paper’s top-left corner), how big it draws (scale, paper mm per model unit) and its projection kind. The saved view’s own camera is what the placement projects through; its zoom (halfHeight) is NOT the sheet scale — a sheet says how large the part draws on paper, the camera only says from where.

§This slice

Orthographic only: a placed view whose saved camera is perspective is REFUSED at placement with a message rather than silently flattened (EngineState::sheet_place_view, and the placement form that re-points a placement). Hidden lines are removed exactly, on the B-rep — see hlr for the pass and its floors, project for the placements, and docs/panels/sheets.md for the user-facing contract.

Modules§

dimension
Sheet dimensions — a dimension drawn ON the paper, anchored to the projected geometry of a placed view rather than to a PMI annotation.
frame
The paper’s own furniture: the drawing BORDER and the TITLE BLOCK.
hlr
The ANALYTIC hidden-line pass: what a sheet draws of the model, computed from the B-rep rather than from the display mesh.
ordinate
Ordinate sets — a DATUM and a run of members, each reading its signed distance from the datum along one axis of the paper.
pdf
The sheet’s PDF output contract — a minimal PDF 1.4 writer, no crate (1.7 when it carries a 3D model; see the last section).
pdf3d
The live 3D model a sheet PDF can carry — a U3D stream (super::u3d) and the PDF 1.7 dictionaries that show it (ISO 32000-1 §13.6).
print
Manufacturing instructions on paper: the printed pages and the per-step pictures, drawn as sheets.
project
Projecting a placed PMI view onto its sheet: the model as edge LINES with hidden lines removed, plus EVERY annotation of the saved view, all in paper millimetres.
svg
The sheet’s SVG output contract.
u3d
A U3D (ECMA-363) writer — the 3D stream a PDF /3D annotation carries.

Structs§

BomTable
A live assembly parts list placed in paper millimetres.
DetailCircle
The circle of a detail view, as it was PICKED: two anchors of an existing placement’s projection — the circle’s centre and a point on its rim.
PlacedView
A saved PMI view placed on a sheet.
Revision
One row of a sheet’s revision table: the revision’s letter, its date and what changed. All three are the user’s own text — a drawing office letters, dates and words its revisions its own way — so none is validated beyond being a string, and a blank one leaves its cell ruled and empty.
SectionCut
The cutting plane of a section view, as it was PICKED: two anchors of an existing placement’s projection.
Sheet
One sheet of paper.
SheetState
The document’s sheets block.

Constants§

CUSTOM
The size value of a sheet whose widthMm / heightMm are the user’s own.
DEFAULT_BORDER_INSET_MM
The default inset of the drawing BORDER from the paper’s edge, millimetres.
DEFAULT_SCALE
The default scale of a newly placed view (1 mm of paper per model unit).
DEFAULT_SIZE
The default paper size of a new sheet.
DETAIL_SCALE_FACTOR
A new detail view draws at this multiple of its source’s scale — the usual reason for a detail is that the source is too small to read there.
ORTHOGRAPHIC
The only projection kind this slice draws.
PAPER_SIZES
The paper-size presets, (key, width mm, height mm) — ISO A landscape plus the two ANSI sizes in millimetres (the block stores millimetres only, so a Letter sheet is 279.4 × 215.9 and not a second unit system).
SHEETS
The document key the block is stored under.

Functions§

detail_view_schema
The Detail view dialog’s schema: the circle — its CENTRE and a point on its RIM, each an anchor picked on one placed view — its letter, and where the enlarged view sits and at what scale.
paper_size
A preset’s millimetres, or None for CUSTOM and anything unknown.
schema_catalogue
The sheet object schemas, in the inputParamsSchema vocabulary the shared form engine already renders (crate::features::form_fields_from_schema), so neither dialog is hand-written. view_ids are the document’s saved PMI views — the options of a placed view’s view field, which is why this catalogue is built per document rather than being a static.
section_view_schema
The Section view dialog’s schema: where the view sits and at what scale, and the section itself — its CUTTING LINE, two anchors picked on a placed view with the reference picker, its letter and which way it looks. Its saved view is its source’s, so it has no view field of its own.
sheet_schema
The Sheet dialog’s schema.
sheet_view_schema
The Placed view dialog’s schema. view offers the document’s saved PMI views; projection offers only ORTHOGRAPHIC in this slice.