Expand description
EngineState — the windowing-agnostic viewer state machine the host UI
programs against (R3): scene + camera + controls + settings + emphasis, plus
the whole event/command/query surface (run-history feed, pointer/wheel
ingestion, camera commands, picking, world→screen, visibility). No GPU, no
canvas — the wasm Engine and the winit desktop shell both wrap this; it is
fully unit-testable on native.
Everything crosses the R3 boundary as plain JSON/scalars: the host never holds a renderer object, only names, ids, and JSON.
Modules§
- cam_ops
- The CAM workbench’s engine-side seams: the reference picker for a CAM
record’s field, committing into the document’s
camblock. - replace_
component - Replace component (swap an occurrence’s part, keep its mates by name when
the parts share lineage; mark the rest unresolved) —
replace_components, the report, repair, and the Save As lineage stamp. REPLACE COMPONENT: swap the part an ACOMP occurrence (or every occurrence of a part) shows, keeping the occurrence — its id, pose, fixed flag and attributes — and every mate that still has something to hold on to.
Structs§
- Baked
Frame - One baked frame: every movable occurrence’s world pose (row-major 4×4, the kernel’s spelling), and whether the mates held it.
- Board
Build - What
EngineState::refresh_board_geometrybuilt, for the tests and the cost figures in the validation record. - CageArm
- The gizmo’s cage subject: which points, and the grab snapshot of a drag.
- Cage
Summary - The cage as the editor’s panel describes it.
- Clearance
Pair - One NEAR-MISS component pair: no interference, but the gap between them
is at or under the clearance threshold.
distance(mm) is measured over the display tessellation;witnessis the closest point onathenb. - Component
Info - One assembly component instance as the APP sees it: the owning ACOMP feature
id, the parts-library part name, the authored rigid pose (
inputParams. transform—{translate, rotateEulerDeg}, intrinsic-XYZ degrees), the grounded flag, and the member solid names currently in the display scene. - Component
Move Arm - The component-Move controller state (one per engine, like
TransformArm). - Connection
Patch - A patch the panel applies to one connection: every field optional, only the present ones change.
- Constraint
Drag - A live constraint-handle drag: which constraint + which
inputParamsfield (distance/angle), the params snapshot the commit mutates, and the live preview value the overlay/label show while dragging. - Embedded
Only - The sink that stores nothing: every entry stays embedded-only. The default for headless callers and tests, which have no store to write to.
- Engine
State - Explode
Playback - The animation state of the active view’s steps.
- Explode
Step - One step of an exploded view (an
exploderow of a PMI view). - Exploded
View - A PMI view that holds explode steps.
- Expression
Preview - A transient expressions source for
EngineState::set_expression_preview. - Insertion
- A step’s insertion motion in the in-app player: its arrowed parts start out along their arrows and move home. Display poses only (the explode machinery’s), never a write to the document.
- Instructions
PdfExport - A PDF prepared over successive frames. Heavy exact passes run on the history runner. Dropping this job cancels delivery; the document stamp prevents mixed-revision output.
- Interference
Pair - One INTERFERING component pair: the two owning ACOMP feature ids, their summed intersection volume (mm³, over all member-solid cross pairs), and whether either participant is currently hidden (it still participates — the window notes it).
- Interference
Report - The result of one interference run — everything the results window shows.
pairsempty +skipped/unverifiedempty = the green all-clear. - Motor
Mate - A mate a motor can drive.
- PmiLabel
- One chip of
EngineState::pmi_labels; serialised, the__brepPmiLabelsrow. - PmiModeling
Snapshot - The modeling state remembered while the PMI workbench is active.
- PmiView
Patch - A patch the panel applies to one view’s name / display state.
- Published
Motion - A study of the assembly whose published motion a step can take.
- RefSelect
Field - The active reference pick as a FORM sees it (see
EngineState::ref_select_field): the subject whose field is being filled, the field’s path, and the running list. - RefSelect
State - The modal state of the reference-selection widget while it is ACTIVE: which feature-dialog field is being filled, what it accepts, and the running list of picked kernel names (the source of truth — added by picking in the view, removed via the per-line X). See the ref-select methods below.
- Selection
Filter - Which entity KINDS a plain viewport click may select.
- Simulation
Playback - The study being played or scrubbed, its bake so far and what the displays show of it.
- Sketch3d
Edit - The active 3D sketch edit.
- Sketch
Constraint Action - One applicable-constraint palette entry: the glyph passed back to
EngineState::sketch_add_constraintplus a human tooltip and a dimensional tag (whether it opens a value the solver seeds from the current measurement). - Sketch
Drag - One in-flight sketch drag (S2): the grabbed points and the anchor uv. A single
entry for a point grab; a geometry’s movable (deduped) points for a geometry
grab. Locked endpoints stay anchored. Each point tracks the cursor by an ABSOLUTE
orig + (uv - anchor)(never incremental — the solver moves points between frames, so incremental deltas would drift). - Sketch
Edit - The active engine-native sketch edit — the live session plus the state to restore when sketch mode exits.
- Sketch
Entity Row - One row in a sketch entity-LIST panel (Points / Curves / Constraints) — the
display label plus the
(kind, id)needed to select / hover / delete it, and its current selected/construction state for row styling. Built byEngineState::sketch_point_rows/sketch_geometry_rows/sketch_constraint_rows; the panel renders them and routes clicks back throughEngineState::sketch_select_entity/sketch_hover_entity. - Spline
Anchor Row - One anchor as the editor lists it.
- Step
Assembly Import - The choices the import dialog collects.
- Step
Assembly Probe - What the import dialog needs to describe a STEP file’s structure — counts only, so the probe can answer without building anything.
- Step
Assembly Report - What an import did — the numbers the status line and notice report.
- Transform
Arm - The transform-controls gizmo controller state (see the impl block below).
- Typed
Move - The outcome of one typed move (
EngineState::component_move_typed): the field, the value typed, how much of it the mates let through along that axis, and the constraints that stopped the rest. - Wire
BomLine - One wire as a BOM line.
Enums§
- Cage
Select - How a pick or a list action changes the selection.
- Component
Insert - What a component-insert names: an EXISTING parts-library entry (skip the
store read — just add an instance) or a NEW part payload to hand to
add_part_to_library(which dedups by sourceKey+signature and returns the EFFECTIVE entry name the instance must reference). - Gizmo
Mode - Which of the two gizmos is currently armed for the feature.
Transformshows the move/rotate gizmo;Dimensionshows the on-canvas draggable dimension annotations (feature-dimensions FD-1). Expanding a feature armsDimension; the viewport sphere/center toggle flips toTransformand back. The two modes are EXCLUSIVE — the transform gizmo never renders inDimensionmode and vice-versa. - Instructions
RefField - Which occurrence field of a step a pick fills (
RefSelectTarget::Instructions). - Notice
Severity - How a notice is drawn: an
Error(a refusal, a failure — whatEngineState::push_noticequeues), aWarning(it worked, and something needs a look) orInfo(it worked: “Updated 2 part(s)”, “Saved ‘widget’”). - PlayTo
- Where the player goes.
- Port
RefField - Which of a connection point’s two reference fields a pick is filling.
- RefSelect
Target - WHO a finished reference-selection commits to: a history FEATURE’s params
(the original widget) or an ASSEMBLY CONSTRAINT’s
inputParams(same modal, different commit lane — seeassembly_ops::begin_ref_select_for_constraint). - Sketch3d
Cursor Hit - What a cursor position resolved to when placing a point.
- Step
Probe Outcome - What a STEP probe found, as the file panel consumes it (see
EngineState::submit_step_probe). - Wire
Length State - Why a wire line has, or has not, a cut length.
Constants§
- BOARD_
SOLID_ PREFIX - Every board body’s name leads with this, so the scene, the Scene tree and
the stale sweep can tell one apart from a feature’s solid. No
:— that is the occurrence namespace an assembly reads. - CAGE_
PICK_ RADIUS_ PX - A viewport click within this many CSS pixels of a dot picks it.
- INSTRUCTIONS_
IMAGE_ PX - A per-step PNG’s edge, in pixels.
- INTERFERENCE_
OVERLAY_ GROUP - The viewport overlay group carrying the interference volumes (red triangles) and the near-miss gaps (amber segment + end points).
- OCCURRENCE_
ATTRIBUTES - The ACOMP
inputParamsattribute-record key. - PART_
ATTRIBUTES - The part document’s attribute-record key (see the module’s BOM-attributes
block). A top-level document key, so it rides save/open untouched. Defined
by the kernel, which reads the record’s
Part_NumberforPRODUCT.idon a structured STEP export. The top-level document key holding a part’s own BOM attribute record ({ "Part_Number": "PN-7", "Material": "6061", ... }). Owned by the app’s document model; the kernel reads it only to stampPRODUCT.id. - SUBSTRATE_
SOLID - The substrate body’s scene name.
- TOPOLOGY_
WAIT - How long an export waits for the runner’s topology reply before it draws
what it has (
EngineState::instructions_topology_ready). - VIAS_
SOLID - The via-barrel body’s scene name.
Traits§
- Part
Sink - Where an imported assembly’s unique parts are written, so each becomes a document in its own right rather than a payload embedded in one assembly.
Functions§
- assembly_
signature - The signature of an assembly document a published motion was made from: the document’s content hash with every study’s published motion left out, so it reads the same before and after a publish and differs once anything else in the document (parts, mates, a study) changes.
- board_
default_ color - The colour a board body or one of its FACES draws in when the metadata store
has none of its own for it — the fallback
sync_colors_from_metadatareaches for, since a derived body has no producing feature to have been coloured by.Nonefor every name that is not a board body’s or a face of one; a storedcolorattribute still wins over all of it. - document_
signature - A STABLE content signature of a document: a sorted-key JSON walk hashed
with the (fixed-key, cross-process-deterministic) std SipHash. The ONE
signature fn, at the ENGINE altitude so app-side and engine-side writers
share one copy: the app’s insert flow (
panels::file), the edit-in-place Finish (panels::assembly_edit::refresh_library_entry) and the update-components comparison (panels::update_components) all write/compare a parts-librarysourceSignaturewith THIS function — a freshly inserted, unchanged part must always compare up-to-date, which a second copy would break the moment either drifted. Uses the kernel’s shared sorted-key hash, also used for in-memory library fingerprints. Invalid JSON retains the raw-text hashing fallback. - nested_
fixed_ state - A nested occurrence’s Fix/Float as the assembly solve reads it.
- pmi_
view_ params - A view’s current values in
pmi_view_schema’s shape — the form’s seed. - pmi_
view_ schema - The PMI view dialog’s schema — what a view’s own form edits: its name,
the text size its labels draw at and whether it shows the model in
wireframe, plus the two re-capture actions its row menu also offers. Shaped
like every other object schema so the shared form view draws it;
EngineState::pmi_update_viewapplies what it edits. - world_
vertex_ ref {solid}@x,y,zin WORLD coordinates (the PMI vertex-ref convention).