Entity assignments¶
An entity assignment is a reference to a specific geometric entity (a face, an edge, a body) of an input data instance. Workflows that operate on geometry — boundary conditions, mesh refinement, post-processing on a specific entity — express the "which face?" / "which edge?" piece as entity assignments.
Schema fields¶
An entity assignment field is declared with one of the DSL builders, which come in single and list flavours:
Every builder takes the field name and an optional modelFieldName.
There is no entityAssignment(...) builder: you always pick the builder
that matches the dimensionality and the source you accept.
Whichever builder you use, it fills in the following two sets, that together decide what the user is allowed to select:
allowedEntityTypes— the entity types the field accepts; for example,cadSolidFacenarrows this toSOLID_FACEalone,cadFacetoSOLID_FACEandSHEET_FACE.allowedSourceTypes— what those entities belong to:CAD,MESH, or both.
Sets, not single values, because one field can legitimately accept faces of solids and faces of sheets. What it must not mix is dimensionality: faces and bodies never share an assignment, since nothing downstream could treat them alike.
Entity types¶
CAD entities are typed by their spatial dimensionality combined
with the topology they belong to. There is no plain "face" type:
the faces of a solid are SOLID_FACE, the faces of a sheet are
SHEET_FACE. Every face belongs to exactly one body, so its type
is unique and follows from the body itself.
The CadEntityType constants:
| Dimensionality | CAD entity types |
|---|---|
| Body | SOLID, SHEET, WIRE |
| Face | SOLID_FACE, SHEET_FACE |
| Edge | SOLID_EDGE, SHEET_EDGE, WIRE_EDGE |
| Vertex | SOLID_VERTEX, SHEET_VERTEX, WIRE_VERTEX, ACORN_VERTEX |
The gaps are real, not omissions — a wire has no faces, an acorn is a lone vertex.
Mesh entities have no topological flavour yet, so they still use
the dimensionality-only EntityType (VERTEX, EDGE, FACE,
REGION).
Choosing a builder¶
A builder's name states the source it assigns from, the
dimensionality it assigns, and how far it narrows the selection.
Each has a List counterpart declaring the multi-selection form of
the same field, e.g. cadSolidFace and cadSolidFaceList.
CAD builders¶
cadFace allows a face of any CAD body, cadSolidFace only a face
of a solid. The other dimensionalities follow the same pattern:
| Dimensionality | Any CAD flavour | Restricted to one flavour |
|---|---|---|
| Body | cadBody |
cadSolid, cadSheet, cadWire |
| Face | cadFace |
cadSolidFace, cadSheetFace |
| Edge | cadEdge |
cadSolidEdge, cadSheetEdge, cadWireEdge |
| Vertex | cadVertex |
cadSolidVertex, cadSheetVertex, cadWireVertex, cadAcornVertex |
Prefer the narrowest builder that still fits: a field declared
cadSolidFace rejects a face picked off a sheet, which is exactly
the mistake you want caught at configuration time rather than
inside the solver.
Mesh builders¶
Mesh entities carry no topological flavour, so there is nothing to narrow — one builder per dimensionality, and so far only two:
| Dimensionality | Mesh |
|---|---|
| Body | meshRegion |
| Face | meshFace |
Mesh edges and vertices have no builder of their own yet.
Accepting several sources¶
A field on a workflow that takes a CAD or a mesh input is
declared with body, face, edge or vertex, which take both
sets as arguments. They deliberately have no default for
allowedSourceTypes, so the choice is explicit:
allowedEntityTypes defaults to every entity type of that
dimensionality from either source; pass a subset to narrow it:
body(
allowedSourceTypes = setOf(CAD),
allowedEntityTypes = setOf(SOLID, SHEET),
name = "shellOrSolid",
)
Rules the field enforces¶
An entity assignment field is always optional — it has an implicit default that models "nothing assigned", and there is no way to declare it mandatory. A field that must be assigned is expressed as a validation rule on it instead.
Beyond that, declaring a field fails when:
allowedEntityTypesis empty.MESHis an allowed source but the only allowed entity types areCadEntityType— no mesh entity could ever satisfy the field.CADis an allowed source but the only allowed entity types are dimensionality-onlyEntityTypeconstants — a CAD entity is always typed by the body it belongs to, so a plainFACEnever matches aSOLID_FACE.
Mixing dimensionalities, e.g. a face type and a body type in one set, is not rejected. Declaring fields through the builders is recommended.
Source binding¶
An entity assignment doesn't carry the entity itself; it carries a
source plus entity IDs. The source is which input data
instance the entity belongs to (a workflow input, a previous
operation's output). The framework's EntityAssignmentSource and
SourceType types encode this.
At run time, the platform resolves the source to a concrete data instance and looks up the referenced entity IDs inside.
Saved selections¶
Besides individual entity IDs, an assignment can reference a saved selection — a named group of entities the user defined upstream. A single-selection field accepts a saved selection only when it resolves to exactly one entity.
Validation¶
At run time, the platform checks each assignment against the source:
- Every assigned entity must exist in the model and its entity
type must be one of the field's
allowedEntityTypes. - Every assigned saved selection must exist, and the entities it holds must be of an allowed type.
- A single-selection field rejects a saved selection holding more than one entity.
The entity type used in these checks for a CAD source comes from the CAD topology. Assignments whose source cannot be resolved to a single CAD model are skipped rather than reported, so validation never claims more than it can verify.
In value-model expressions¶
Entity-assignment value types appear in the expression language:
EntityAssignmentValue— single reference.EntityAssignmentListValue— multiple references.EntityAssignment.isEmpty(),.countEntities()— predicates and size queries..toString()/.toMarkdownLink()— for messages and reporting.
Common in validation rules ("at least one boundary must be marked inlet"), in inline operations that map across entities, and in configuration mappings into method calls.
What this is not¶
- Not a copy of the geometry. The entity assignment is a reference. Mutating the source data invalidates the reference.
- Not the geometric data itself. The source data instance carries the actual face / edge / body definitions. The assignment just picks one (or many).
When you'd use them¶
Components that operate on real CAD or mesh geometry — boundary condition sets, named-selection workflows, region-of-interest methods. If your data type is purely numerical (a length, a result table), you won't need entity assignments.
Migrating older components¶
| Before | Now |
|---|---|
cadRegion / cadRegionList |
cadBody / cadBodyList, or the narrower cadSolid / cadSheet / cadWire |
region / regionList |
body / bodyList |
allowsCadEntityAssignments = true |
allowedSourceTypes = setOf(CAD) |
entityType = FACE on a CAD field |
allowedEntityTypes = setOf(SOLID_FACE, SHEET_FACE), or just use cadFace |
cadFace() |
cadFace("cadFace") — the field name is no longer defaulted |
meshRegion / meshRegionList keep their names.
Cross-references¶
- CAD models — the bodies, faces, edges and vertices that CAD entity types describe.
- Schema description language — for the field declarations.
- Value models — for the entity-assignment expressions.
- Reference: schema DSL — full options for entity-assignment fields.