Skip to content

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 ​

python
grid_normals(surface: np.ndarray) -> np.ndarray

source

Unit normals (na, nb, 3) of a structured surface grid (na, nb, 3).

wall_normals function ​

python
wall_normals(blocks: list[HexBlock]) -> dict[bytes, np.ndarray]

source

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 ​

python
hermite_lines(
    lines: np.ndarray,
    normals: np.ndarray,
    strength: float,
    samples: int = 64,
) -> np.ndarray

source

Lines (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 ​

python
in_planes(normals: dict[bytes, np.ndarray], planes: Sequence[Any], tol: float) -> None

source

Project, in place, the normal of every node lying on one of planes ((point, unit normal) pairs, within tol) into that plane.

orthogonal_walls function ​

python
orthogonal_walls(
    blocks: list[HexBlock],
    strength: float = 1.0,
    planes: Sequence[Any] = (),
) -> list[str]

source

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 ​

python
layer_fractions(length: float, n: int, first_step: float) -> np.ndarray

source

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

python
wall_layer(blocks: list[HexBlock], first_step: float) -> list[str]

source

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.

Released under the MIT License.