Skip to main content

Module feature_pipeline

Module feature_pipeline 

Source
Expand description

Feature-history execution with exact name resolution and stable output names.

execute_history updates its live SceneMap after every feature. Reference parameters resolve by exact name; misses produce structured unresolved entries in FeatureResult. Output names must preserve saved-document naming conventions because later features store those names as references.

Feature descriptors retain {type, inputParams, persistentData, timestamp}. Numeric parameters accept literals or expressions evaluated against Env.

Registry borrows stay local to each operation and never span feature execution. Features call Rust operations directly, preserving names on resident solids. Removed scene solids and consumed intermediates must release their handles.

Re-exports§

pub use assembly::AssemblyState;
pub use assembly::ConstraintEntry;
pub use context_offer::feature_context_applicable;
pub use context_offer::SelectionProbe;

Modules§

assembly
Assembly constraint state, lifecycle, and solver mapping.
context_offer
Selection-context applicability — kernel-owned show/no-show for the app’s selection context bar.
extension
Scoped, interpreter-independent history extension provider.
nurbs_solid
The NURBS Solid’s cage resolver, which the engine’s cage editor reads its handles through (resolve_cage, primitive_cage, has_persisted_cage). NS — NURBS Solid: a smooth body shaped by a control cage.
part_pins
A part’s symbol pins ARE its harness ports, bound by label (eCAD plan decision 8): the pin/port report, following an edit from one side to the other, and resolving a placed part’s pin to its port id (see part_pins.rs). A part’s symbol PINS are its declared connection POINTS (eCAD plan decision 8: pins and points are bound in the part, never on an assembly or a placed component).
pmi
PMI — Product and Manufacturing Information: the document’s pmi block (views that own annotations), the annotation type table with its schemas and selection predicates, and the history tail that resolves every annotation against the just-built scene into a typed PmiReport.
ports
PORTS — a part’s declared connection points, as PART DATA rather than history features.
wire_harness
Wire-harness routing: the document’s wireHarness block, the sided port graph, per-connection routes and the bundle solids — solved at the tail of every run like assembly (see wire_harness.rs). Wire harness — the document’s wireHarness block, the SIDED port graph, per-connection routing, and the bundle solids. Solved at the tail of every history run (like assembly), against the ports and spline segments the run published.

Structs§

AddedSolid
A solid produced by a feature: its resident handle, its solid name, and its named faces/edges ((topology_id, name)). the caller tessellates/pulls names via the handle; the scene-map registers the names for downstream reference resolution.
Axis
A named world-space line — a revolve/sweep axis. Published by SKETCH features (every sketch line geometry, construction included) and resolvable from a resident solid edge, so an axis/path reference resolves fully headless.
ComponentRecord
One scene component: an ACOMP instance’s identity, pose, and member solids. Rides the crate::feature_pipeline::FeatureResult components side-channel into SceneMap::apply, exactly like profiles/frames — the scene’s component set is rebuilt from feature results every history run (a projected view, never an owning data structure).
EdgeRef
Env
The expression environment: the variable bindings produced by evaluating the prelude (resolution = 32), the injected configurator object, and the user’s expressions statements in order.
FaceRef
FeatureContext
The read-only context handed to each feature’s execute. Features resolve their reference_selection params against scene and read numeric params via FeatureContext::number (which evaluates expression strings against env).
FeatureDescriptor
One feature as serialized by PartHistory.toSerializable. Permissive: unknown fields are ignored, so an entire saved part file’s features[] deserializes as-is. input_params stays a serde_json::Value (an object) so features read their own params with their own type knowledge (which params are numeric).
FeatureResult
Frame
An orthonormal placement frame — a named plane (DATUM/PLANE feature) or a resolved sketch plane. z_axis is the plane normal.
Fulfilment
What a SUCCESSFUL feature did with what it was asked, when that is not “everything, exactly” (plan: typed-refusal-reporting, item 3). Requested and applied are reference names as the document wrote them; every rejected one says which kind of rejection and why. A partial fulfilment is a different answer from the one asked for, so it is reported on the feature that made it and displayed by the app beside the feature; it is never a refusal class (a partial selection is a separate outcome) and never carries geometry.
HistoryProgress
A feature about to EXECUTE inside execute_history_observed — a dirty one, not a cached replay (replays are instant and are not reported).
HistoryRequest
The execute_history_json request: the expression source, the configurator state, and the ordered feature list. Permissive — a whole saved part file parses as a request (extra top-level fields ignored).
HistoryResult
The whole-history output.
IsolatedSceneMetadata
The take_store/restore_store bracket as an RAII guard, for OUT-OF-CRATE producers that build a payload against a LIVE document.
PartsLibraryEntry
One unique part payload. dirty is RESIDENT-ONLY state: set by refresh_library_entry (edit-in-context / update-components) when the new document builds differently, it forces the ACOMP self-heal lane on the next run even with a readable snapshot, and clears when the heal rewrites the snapshot.
PortRecord
One resolved connection point, keyed in SceneMap::ports by its ADDRESS (J1.VCC, ACOMP3:J1.VCC once placed - see ports.rs). Published by the ports tail, by the WAYPOINT feature (under its own feature id) and by an ACOMP re-publishing a placed part’s points.
ProfileLoop
One closed boundary of a SketchProfile: head-to-tail world-space curves plus the per-curve source edge name ({sketchId}:G{gid}, parallel to curves). The profile-consumers stamp sidewall names from edge_names (extrude → {name}_E).
Rejected
One reference a successful feature did not act on.
SceneMap
The live scene-map. Exact-match resolution only (contract rule 1).
ScenePoint
The output of one feature execution. A named world point a feature published (a SKETCH publishes every solved point as {sketchId}:P{pid}; a spline its anchors, a helix its ends). construction carries the sketch point’s own flag: a construction point (the sketcher’s ◐ toggle, or a materialized external reference) still resolves by name — a helix may start at one — but it is NOT model geometry, so a placement consumer (the hole) skips it exactly as the profile skips construction lines. Serialized because the render-side build report carries it across the worker boundary.
SketchProfile
A solved sketch’s extracted profile, placed in 3D. Produced by the SKETCH pipeline feature and consumed BY NAME by the profile-consumers (extrude, revolve, loft, sweep, rib, sheet-metal tab/contour-flange) — the exact-BREP replacement for the old “marshal the resolved curves into inputParams”.

Enums§

FeatureRefusal
What a feature’s build hands back when it refuses. A feature that drives a typed producer propagates the KernelRefusal whole (? converts it), so its class reaches FeatureResult::refusal; one that drives a stringly producer propagates the text. There is no From<FeatureRefusal> for String: the text of a typed refusal is read through FeatureRefusal::message, never by dropping the class.
PortKind
What a connection point is to the harness router: a cable END, or a pass-through that joins spline paths into a network. Not a user param any more - it is decided by WHICH producer made the record (a declared port point is a termination, a WAYPOINT feature is a waypoint).
RejectedKind
Why a reference was rejected. Closed; a new kind is a producer that exists.

Functions§

add_part_to_library
INSERT: hand the opened sub-part document over to the library. Executes the document once, snapshots, stores the entry, and returns the EFFECTIVE part name (the ACOMP partName the app must reference):
add_part_to_library_impl
add_part_to_library for native callers: the same insert, its error as text.
annotate_rename
Annotate an UNRESOLVED reference with the name that replaced it, when the miss looks like the per-loop naming change.
assign_sketch_loop_ids
Assign every closed loop’s id onto the geometries of a SOLVED sketch document, in place, and report whether anything changed.
clear_history_cache
Drop the whole cache, freeing every owned handle + tree. Called by the caller on a part/document switch (and by every Rust test for hermeticity).
clear_history_cache_json
wasm boundary for clear_history_cache.
execute_feature
Resolve one feature descriptor to a FeatureResult against the current scene. Each stub’s arm calls its own features::<feat>::execute so a fan-out agent implementing a feature touches ONLY that file — never this dispatch.
execute_history
Run a whole feature history incrementally: build the expression env once, then walk the ordered features. A CLEAN feature (see the cache section above) replays its cached result; a DIRTY one re-executes (its old outputs are freed first). On a feature error, record it and HALT (abort-on-error); errored results are never cached. Never panics.
execute_history_json
Deserialize a history request, run it, and serialize the per-feature results. The handles in the result are u32s the caller tessellates / pulls names from via the existing *_handle wasm exports.
execute_history_observed
execute_history with a progress observer. observe is called immediately BEFORE each feature the run executes (cached replays are not reported); returning false stops the run at that boundary — the feature is not executed, nothing after it runs, and the result holds what was built so far. The boundary is the only cooperative stop the kernel offers: nothing inside a feature (a boolean, a blend, a sew) checks anything.
face_transform_pivot
The pivot a Transform Face whose faces are names gets by default, read off the scene the results BEFORE it build — the value the app stores into pivot when the selection is committed, and the value build falls back to for a null pivot, because both go through resolve_selection and selection_centre. None when the selection does not resolve to faces on one solid.
feature_hidden_params
The DIALOG FIELD-VISIBILITY hook, kernel-owned like the schemas themselves.
feature_schema_catalogue
Assemble the catalogue from every feature’s own schema(). The assembly constraint schemas join the export under their own assemblyConstraints namespace so the dialog engine renders them with the same machinery.
first_reference_name
The first reference name of a reference_selection param value (a plain string, a {name} object, or an array of either — post-sanitization it is an array). Exact match only; no [N] index / snapshot scoring.
flat_pattern_dxf
Export the flat pattern of the sheet-metal body handle as DXF (R12 ASCII). Runs the unfold TRANSIENTLY off the resident tree — no feature, no history mutation. Errors if the handle carries no sheet-metal tree.
flat_pattern_svg
Export the flat pattern of the sheet-metal body handle as SVG — the DXF sibling of flat_pattern_dxf.
follow_saved_rows
The rows rule of refresh_library_entry_impl for a door that rewrites an entry’s document in the partsLibrary block itself (the app’s Update components): that block is what Save writes. Rows taken from old follow the same build of new; any other rows are dropped, as no reopen could take them.
follow_saved_rows_known
follow_saved_rows for a caller that has already asked same_build(old, new): it is not asked again (each asks parses both whole documents as requests, ~5 ms for an l500 module).
install_parts_library
INSTALL a library wholesale — the app → history-runner channel (the runner owns its own thread-local store, and the per-run request no longer carries the block, so this is how a background thread/worker learns the library).
is_sheet_metal_handle
Whether the resident solid handle carries a sheet-metal tree — the SheetTree-free predicate the export lane filters resident solids with (so the native engine picks the flat-pattern target without touching SheetTree).
kernel_source_stamp
This build’s identity for PartsLibraryEntry::snapshot_producer: the hash of the kernel source that build.rs computes. None when the build could not compute it, which disables stale-snapshot invalidation rather than making every snapshot look stale on every run.
missing_library_parts
The PREFLIGHT for a run: every part name the request’s ACOMP features reference that the root store cannot resolve, in request order.
native_import_payload
Encode solids as a native IMPORT3D payload: stamp the names this feature would stamp under feature_name, then seal them into the io/snapshot container. The result is exactly what the nativeBrep source above reads back, so a part is named identically however it arrived — imported live from a text source, or restored from a payload built here.
native_import_payload_with_appearance
native_import_payload carrying the import’s COLOURS into the payload.
parts_library_json
The current library in the partsLibrary block shape — what SAVE must serialize into the document (never the loaded block: this copy carries healed snapshots, refreshes, and GC).
parts_library_map
A CLONE of the root store — what the app hands a runner through install_parts_library. (parts_library_json is the SAVE door; this is the in-process one, with no JSON round trip on the native paths.)
parts_library_revision
The ROOT store’s current revision (see REVISION). Two reads that differ mean the library changed in between; two that agree mean it did not.
pattern_component_instance
A Pattern Component instance id (APAT1.ACOMP3.i4) as (pattern, seed, n).
pattern_parse_suppressed
The part Pattern’s suppressed instance numbers, as the feature reads them.
reference_names
ALL reference names of a reference_selection param, in order (a multiple selection). Also accepts a single string or {name} object; empties are dropped.
refresh_library_entry
UPDATE (update-components / edit-in-place commit): replace an existing entry’s document + signature. When the new document BUILDS differently (same_build) the entry is marked DIRTY: the next history run’s ACOMP self-heal lane re-executes the document, re-snapshots, and every instance of the part follows. When it builds the same — only its symbol, pads or BOM attributes moved — the snapshot and ports still describe it and are kept, so the part is not rebuilt for an edit that changed no geometry.
refresh_library_entry_impl
refresh_library_entry for native callers: its error as text.
same_build
Whether two part documents build the same solids and ports, so that one’s snapshot serves the other.
scene_metadata_colors_json
Every record carrying an imported COLOUR, as {name: "#RRGGBB"}.
stable_json_hash
Stable content hash of a JSON value: sorted-key walk (never trusts a serializer’s map ordering), string leaves verbatim.

Type Aliases§

PartsLibraryMap
The library map shape as it travels in the history request / save file.