Skip to content

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 ​

python
Association(geometry: str, kind: EntityKind, keys: tuple[EntityKey, ...] = ())

source

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) or POINT.
  • keys — Fingerprints of the associated entities; empty for BODY.

Association.body classmethod ​

python
body(geometry: str = BODY_GEOMETRY) -> Association

source

Association with the whole body.

Association.of classmethod ​

python
of(geometry_name: str, geometry: Geometry, refs: list[EntityRef]) -> Association

source

Association with entities refs of geometry (all of one kind).

Association.to_json method ​

python
to_json() -> dict[str, Any]

source

Association.from_json classmethod ​

python
from_json(data: dict[str, Any], *, source: str = '<association>') -> Association

source

AssociationResolver class ​

python
AssociationResolver(geometries: dict[str, Geometry], *, exact: bool = False)

source

Resolves associations to current EntityRefs and projects nodes.

Parameters

  • geometries — Geometry map, keyed like Association.geometry.
  • exact — Project with exact=True (tier 2) instead of the tessellation.

AssociationResolver.refs method ​

python
refs(assoc: Association) -> list[EntityRef]

source

Current entities of assoc; raises if any key is lost.

AssociationResolver.project method ​

python
project(assoc: Association, points: np.ndarray) -> np.ndarray

source

Project points (..., 3) onto assoc; nearest entity of a set wins.

snap_block function ​

python
snap_block(block: HexBlock, resolver: AssociationResolver) -> None

source

Project 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 ​

python
associate_wall(block: HexBlock, assoc: Association) -> None

source

Associate block's k_lo face, its 4 edges and 4 corners with assoc.

Released under the MIT License.