CAD models¶
A CAD model is a common input for simulation workflows. On the platform, CAD models are handled by the CAD services and reach workflows as data instances.
Component developers work with CAD models in three ways:
- As data. A workflow input or output that carries a CAD model is typed
by the
simscale.std.cad:cad-modeldata type (successor ofsimscale.cad:cad-model). The model itself stays in the CAD services; the data instance references it. See Data definition. - Through assignments. Configuration fields reference parts of the model through entity assignments. What can be referenced is defined by the model's topology.
- Through validation. The platform checks assignments against the model's topology. Geometric conditions, such as a face being flat, can be checked with the CAD validation helpers.
Data definition¶
| Field | Content |
|---|---|
| Reference | simscale.std.cad:cad-model:<version> |
| Data schema | None (opaque data type) |
| Metadata schema | internalRepresentation, hasFaults |
| Metadata validation | Workflow types can add custom rules |
Metadata schema¶
The metadata schema describes certain traits of a CAD model. The metadata is attached to the data instance and can be read separately from the model, so the platform can, for example, filter the CAD models that suit a workflow input.
| Field | Type | Description |
|---|---|---|
internalRepresentation |
enum InternalCadRepresentation |
PARASOLID, STL, NTOP |
hasFaults |
boolean | Whether the model contains geometric faults (self-intersections, invalid geometry, invalid topology) that may require repair. |
The internalRepresentation metadata field states how the CAD services hold the model.
| Representation | Description |
|---|---|
PARASOLID |
Model held in the Parasolid kernel. |
STL |
Model held as a triangulated surface mesh. |
NTOP |
Model held in the nTop kernel. |
It also determines which topology the model exposes, and therefore which entities can be assigned, and which geometric properties can be queried.
Metadata validation¶
A workflow type can restrict which CAD models an input accepts with a
per-input data validation rule set.
The rules read the metadata through the generated cadModelMetadata
property and apply to that input only, on top of the data type's own rule:
dataInterface {
input("cad", "simscale.std.cad:cad-model:<version>") {
validationRuleSet {
rule(cadModelMetadata.hasFaults, name = "CAD without faults", code = "cad_without_faults") {
error(
condition = cadModelMetadata.hasFaults notEqual true,
code = "cad_has_faults",
message = "The CAD contains faults. Repair it before using it in this workflow.",
)
}
rule(cadModelMetadata.internalRepresentation, name = "Parasolid CAD only", code = "parasolid_only") {
error(
condition = cadModelMetadata.internalRepresentation equal InternalCadRepresentation.PARASOLID,
code = "cad_not_parasolid",
message = "This workflow requires a Parasolid CAD model.",
)
}
}
}
}
A CAD model is suitable for the input when this rule set reports no error. The same rule sets are used to filter the CAD models offered for the input.
Method inputs do not support per-input rule sets. To restrict the CAD models a method accepts, declare the rules on the input of the workflow type that calls it.
Topology¶
The topology of a CAD model is its set of entities and how they bound one another. Entities are bodies, faces, edges and vertices. A model contains one or more bodies, and the type of each body determines which faces, edges and vertices it contains. Faces are bounded by edges, and edges by vertices. Closed entities, such as a spherical face or a circular edge, can have no boundary.
NTOP and STL models have no edges or vertices
Models with the NTOP or STL
internal representation define bodies and
faces only. Edge and vertex assignment fields cannot be assigned on these
models. If your workflow type relies on edge or vertex assignments,
restrict the CAD input to PARASOLID with a
per-input validation rule.
Topology is what component developers work with when referencing a CAD model. An entity assignment selects entities from the topology, a field restricts which entity types it accepts, and validation checks the selected entities against the topology of the assigned model. The sections below describe the body types, the entities they contain, the resulting entity types, and how assignments and validation use them.
Topology and geometry¶
- Topology defines which entities exist and how they are connected. Body, solid, sheet, face, edge and vertex are topological terms.
- Geometry defines the shape underlying each entity: the surface of a face, the curve of an edge, the point of a vertex.
Entity assignments reference topology. Geometric properties, such as whether a face is flat, are queried from the CAD services; see face classification.
Bodies¶
A model consists of one or more bodies. Each body is of one of four types, which determines the entities it contains:
| Body | Description | Contains | Support |
|---|---|---|---|
| Solid | Encloses volume. Has no internal faces. | Faces, edges, vertices | Supported |
| Sheet | Faces without solid volume: open, e.g. a plate, or closed around an empty volume, e.g. a hollow shell. | Faces, edges, vertices | Supported |
| Wire | Edges only, e.g. a beam or frame. | Edges, vertices | Coming soon |
| Acorn | A single vertex, e.g. a probe point. | One vertex | Coming soon |
Faces, edges and vertices¶
- A face is a bounded portion of a surface, possibly bounded by loops of edges.
- An edge is a bounded portion of a curve, bounded by zero, one or two vertices.
- A vertex is a point.
Each face, edge and vertex belongs to exactly one body, so its entity type
includes the body type: a face of a solid is SOLID_FACE, a face of a
sheet is SHEET_FACE.
The distinction matters to the methods that consume the model. A mesher or solver can treat an entity differently depending on the type of body it belongs to, for example in how it is meshed, which degrees of freedom its mesh nodes have, or which boundary conditions apply to it. A face of a solid and a face of a sheet are therefore not interchangeable, and a field can restrict its entities to the body types the consuming method supports.
Entity types¶
| Dimensionality | Solid | Sheet | Wire | Acorn |
|---|---|---|---|---|
| Body-level | SOLID |
SHEET |
WIRE |
— |
| Face | SOLID_FACE |
SHEET_FACE |
— | — |
| Edge | SOLID_EDGE |
SHEET_EDGE |
WIRE_EDGE |
— |
| Vertex | SOLID_VERTEX |
SHEET_VERTEX |
WIRE_VERTEX |
ACORN_VERTEX |
Empty cells are combinations that do not exist. An acorn has no body-level
type; ACORN_VERTEX covers it.
Note
Wire and acorn bodies are not supported yet. The WIRE, WIRE_EDGE,
WIRE_VERTEX and ACORN_VERTEX types and their builders can already
be declared, but no CAD model provides these entities until support
is added.
Typical uses¶
| Dimensionality | Solid | Sheet | Wire | Acorn |
|---|---|---|---|---|
| Body-level | Materials, rotating zones | Materials in shell simulations | Materials in beam simulations | — |
| Face | Boundary conditions, contacts | Loads in shell simulations | — | — |
| Edge | Edge loads in structural simulations | Boundary conditions, contacts | Loads in beam simulations | — |
| Vertex | Nodal loads in structural simulations | Nodal loads in shell simulations | Boundary conditions, contacts | Probe points, point materials |
Cross-references¶
- Data types: data and metadata schemas in general.
- Entity assignments: assignment fields and builders.
- Validation rules: rule sets and the interactive/non-interactive split.
- Reference: CAD validation helpers: geometric checks on assignments.