shore.mesh.orthogonal
Grid lines leaving the walls along their normal (ADR 0048) and wall layers (ADR 0050).
After a premesh (ADR 0042) the lines across a block run from the wall to the opposite face along the transfinite interpolation, so they leave a curved wall obliquely. orthogonal_walls reshapes every line of each block with exactly one WALL face into a cubic Hermite curve that leaves the wall node along the wall's normal (with tangent strength times the line's chord) and meets the opposite node with the line's old end direction; the nodes keep their arc-length fractions, the wall and the opposite face stay put.
The normal of a wall node is the mean of the grid normals of every wall face holding it (each oriented into its block), keyed by the node's exact coordinates: blocks sharing a wall node use the same normal, and blocks sharing a face build its lines identically, so seams stay closed. On a symmetry plane (ADR 0053) the normal of a wall node lying on the plane is projected into it, so the lines from the plane stay in the plane.
grid_normals function
grid_normals(surface: np.ndarray) -> np.ndarrayUnit normals (na, nb, 3) of a structured surface grid (na, nb, 3).
wall_normals function
wall_normals(blocks: list[HexBlock]) -> dict[bytes, np.ndarray]Per wall node, by its coordinates' bytes: the mean grid normal of the wall faces holding it, each oriented into its block.
hermite_lines function
hermite_lines(
lines: np.ndarray,
normals: np.ndarray,
strength: float,
samples: int = 64,
) -> np.ndarrayLines (m, n, 3), wall node first, reshaped to leave along normals (m, 3).
Each line becomes the cubic Hermite curve from its wall node (tangent strength * chord * normal) to its last node (tangent chord times the old last segment's direction); its nodes keep their arc-length fractions, measured on the old line and placed on the curve.
in_planes function
in_planes(normals: dict[bytes, np.ndarray], planes: Sequence[Any], tol: float) -> NoneProject, in place, the normal of every node lying on one of planes ((point, unit normal) pairs, within tol) into that plane.
orthogonal_walls function
orthogonal_walls(
blocks: list[HexBlock],
strength: float = 1.0,
planes: Sequence[Any] = (),
) -> list[str]Reshape, in place, the lines of every block with exactly one WALL face to leave the wall along its normal; the labels of the blocks changed. planes: symmetry planes ((point, unit normal), ADR 0053) whose wall nodes keep their lines in the plane.
layer_fractions function
layer_fractions(length: float, n: int, first_step: float) -> np.ndarrayArc-length fractions (n,) of geometric cells from the wall, the first first_step long, over a line of length (one line at a time, so a line's answer does not depend on the others).
wall_layer function
wall_layer(blocks: list[HexBlock], first_step: float) -> list[str]Redistribute, in place, the nodes of every line across the wall of each block with one WALL face: geometric cells from the wall, the first first_step long, on the line's own polyline; the labels changed.