Skip to main content

Module dimension

Module dimension 

Source
Expand description

Sheet dimensions — a dimension drawn ON the paper, anchored to the projected geometry of a placed view rather than to a PMI annotation.

§The anchor space

Every annotation a sheet drew before this module came from a saved PMI view: it was authored in 3D, resolved by the kernel, and the sheet only projected it. A SHEET dimension is authored on the paper, so it needs an anchor space of its own — and the one thing it must NOT be is a paper position, because the paper position of everything a placement draws moves whenever the camera, the scale, the placement or the model moves.

A SheetAnchor therefore names a point of a placed view’s projection by MODEL IDENTITY:

kindnamesthe point
vertexa placement, a solid and a display vertex’s topology idthe vertex, projected
edgea placement, a solid, an edge NAME and a fractionthat fraction along the edge by arc length, projected
circlea placement, a solid and a CIRCULAR edge’s namethe circle’s centre, projected

An ANGULAR dimension names two edge anchors and measures between the two EDGES rather than between the two points: the point picks which of the four angles at the crossing is meant (each ray leaves the vertex toward its own anchor) and the direction comes from the edge. So the same three candidates per edge serve both, and no fifth anchor kind is needed.

and its reference string is {placement}:{kind}:{solid}#{entity}, with the fraction after an @ on an edge (SV2:edge:Box#Box_NX|Box_NZ[0]@0.5). Edge names are the kernel’s own pipeline names and a display vertex’s topology id is stable across a parameter edit, so an anchor FOLLOWS its geometry: the projection re-runs on every camera, scale, placement and model change, and the anchor is re-resolved against it each time.

An anchor whose geometry is GONE — the edge no longer exists after a model edit, the placement was removed — is not dropped. The dimension keeps its row, DimensionDrawing::error carries the reason, and the sheet draws it in the unresolved style the 3D overlay uses for an annotation that will not resolve. A drawing that silently loses a dimension is worse than one that says which dimension it lost.

A HIDDEN edge is still an anchor. The hidden-line pass decides which model LINES are inked; it has no vote on the anchor space, which is the model’s topology. An anchor on an edge the pass removed resolves exactly as one on a visible edge, and the dimension DRAWS to it — extension line, arrowhead and all — landing on a part of the paper where no model line was drawn. That is what dimensioning a hidden feature looks like on a drawing. The viewport’s picker offers every anchor of a placement for the same reason: it is picking model geometry, not ink.

§The drawing

The layout is the SHARED one — pmi_present, the same function the 3D overlay, the STEP presentation and every placed annotation go through — run in a frame that IS the paper: x to the right, y UP, z out of the page, in paper millimetres. So a sheet dimension’s extension lines, dimension line, arrowheads, value run and line breaking are the ones every other dimension in the product has, and its text is flat on the sheet by construction — there is no annotation plane to project out of.

Two things this module does that the shared layout cannot:

  • The component pair. A HORIZONTAL or VERTICAL dimension measures one component, and the layout draws the dimension line along b - a. The kernel’s own X/Y/Z rule answers that by replacing the second point with its projection onto the measured axis, and this reads the same rule in the sheet’s own axes.
  • Re-seating the extension lines. Because the layout measured that PROJECTED pair, one of its two extension lines starts at the projected point rather than at the anchor it belongs to. Each is re-seated on its true anchor and given the layout’s own overshoot past the dimension line, so a horizontal dimension between two points at different heights reaches both of them.

Structs§

DimensionDrawing
One sheet dimension, laid out in paper millimetres — the sibling of crate::sheets::project::AnnotationDrawing, drawn in its own group by both writers.
SheetAnchor
A parsed anchor reference.
SheetDimension
One dimension drawn on the sheet.
SheetTolerance
The tolerance block a sheet dimension or an ordinate set carries: the PMI dimension’s own four params under the PMI’s own keys (tolMode, tolUpper, tolLower, isReference), read into the kernel’s ToleranceBlock and written by the kernel’s format_dimension — so a sheet value reads 10.000 ±0.050 exactly as the viewport’s label and the STEP presentation of a PMI dimension do. Every key is omitted while it holds its default, so a sheet saved before the block re-serializes byte-identically.

Constants§

ALIGNED
ALIGNMENTS
ANGULAR
CIRCLE
DEFAULT_OFFSET_MM
A new dimension’s offset from its anchors, paper millimetres.
DEFAULT_PRECISION
Decimals in a sheet dimension’s value, matching the kernel’s own linear default.
DIAMETRAL
EDGE
HORIZONTAL
A linear dimension’s alignment: which direction it measures along.
KINDS
LINEAR
The dimension kinds.
RADIAL
VERTEX
The anchor kinds.
VERTICAL

Functions§

anchor_count
How many anchors a dimension of kind takes: TWO for a linear one (the two measured points) and for an angular one (the two measured EDGES), one for a radial or diametral one (the circle).
inherited
The PMI dimension of the placement’s view a sheet dimension INHERITS its tolerance from: none when the sheet dimension carries a block or the reference flag of its own (its own always wins), else the first of the view’s super::project::ToleranceSources that measures what source accepts — the same points, in this view.
layout_dimensions
Lay out every dimension of sheet against the placements already projected into views. centre is where an unresolved dimension writes its reason when it has no anchor left to write it beside.
sheet_dimension_schema
The Sheet dimension dialog’s schema, in the inputParamsSchema vocabulary the shared form engine renders — so the dialog is not hand-written, exactly like the sheet’s and the placement’s.
tolerance_modes
The tolerance modes, in the PMI form’s order, read off the kernel’s own ToleranceMode so the two dialogs cannot offer different lists.