Skip to main content

Module features

Module features 

Source
Expand description

Feature-schema access + the feature-schema → FormField mapping.

The kernel OWNS the feature definitions (feature_pipeline/schema.rs; each features/<feat>.rs declares its own schema() with an inputParamsSchema). This module reaches that catalogue from native Rust (re-exported by the kernel as brep_kernel::feature_schema_catalogue) and maps ONE feature’s parameter schema into the general FormField list the shared egui form engine renders — the SAME FormFields the settings dialog uses.

The map classifies each kernel param type:

REFERENCE-SELECTION field types (rendered as the disabled placeholder — the seam for the next slice’s real picker): the top-level reference_selection params, and the targets list inside a boolean_operation. (transform’s optional start reference is not surfaced here yet.)

Functions§

feature_catalogue
The kernel-owned feature-schema catalogue ({ version, features: [...] }).
feature_default_params
A feature type’s DEFAULT inputParams, built from its schema: one entry per inputParamsSchema param seeded with that param’s default_value (missing → null). The caller assigns the unique id afterwards (the schema’s id default is null). Additive, engine-owned, and reusable by any “add feature” path so a new feature’s params always track the kernel schema. Unknown types yield an empty object.
feature_form_fields
Map a feature type’s inputParamsSchema into the general form fields, in schema (insertion) order — the kernel builds schemas with serde_json’s preserve_order, so grouped fields stay contiguous for the group headers.
feature_long_name
Human display name for a feature type (longName, else the type itself).
feature_schema
One feature’s full schema entry, by its type / shortName (e.g. "P.CU", "B"). None if the type is not in the catalogue.
feature_short_name
A feature type’s SHORT name (shortName, e.g. P.CU, S, E), else the type code itself. This is the BASE for a new feature’s id: the engine appends the part history’s persistent global counter to it (P.CUP.CU7, SS8) in crate::history::History::next_feature_id.