shore.mesh.association
Block-to-geometry association (ADR 0003).
Every vertex, edge and face of a block may be associated with geometry: the whole body, a set of CAD surfaces, a chain of CAD curves, or a CAD point. The nodes of an associated entity are projected onto its geometry after any operation that moves them, with priority vertex -> edge -> face (ICEM's projection order): face nodes first, then edge nodes, then the corners, so the lower-dimensional constraint wins where they meet.
Associations name geometry persistently: geometry is a key into the mesh's geometries ("body" for the meshed body) and keys are EntityKey fingerprints, re-found in the current geometry by match_keys. An association of kind BODY has no keys.
Association dataclass
Association(geometry: str, kind: EntityKind, keys: tuple[EntityKey, ...] = ())Persistent link from a block entity to geometry.
Parameters
geometry— Key of the geometry in the mesh's geometry map ("body"for the meshed body).kind—BODY(whole body),SURFACE(surface set),CURVE(curve chain) orPOINT.keys— Fingerprints of the associated entities; empty forBODY.
Association.body classmethod
body(geometry: str = BODY_GEOMETRY) -> AssociationAssociation with the whole body.
Association.of classmethod
of(geometry_name: str, geometry: Geometry, refs: list[EntityRef]) -> AssociationAssociation with entities refs of geometry (all of one kind).
Association.to_json method
to_json() -> dict[str, Any]Association.from_json classmethod
from_json(data: dict[str, Any], *, source: str = '<association>') -> AssociationAssociationResolver class
AssociationResolver(geometries: dict[str, Geometry], *, exact: bool = False)Resolves associations to current EntityRefs and projects nodes.
Parameters
geometries— Geometry map, keyed likeAssociation.geometry.exact— Project withexact=True(tier 2) instead of the tessellation.
AssociationResolver.refs method
refs(assoc: Association) -> list[EntityRef]Current entities of assoc; raises if any key is lost.
AssociationResolver.project method
project(assoc: Association, points: np.ndarray) -> np.ndarrayProject points (..., 3) onto assoc; nearest entity of a set wins.
snap_block function
snap_block(block: HexBlock, resolver: AssociationResolver) -> NoneProject every associated node of block onto its geometry, in place.
Faces first, then edges, then vertices, so that the lower-dimensional association wins at shared nodes (vertex -> edge -> face priority).
associate_wall function
associate_wall(block: HexBlock, assoc: Association) -> NoneAssociate block's k_lo face, its 4 edges and 4 corners with assoc.