Skip to content

shore.mesh.redistribute ​

Redistributing the nodes of a block edge (ADR 0041).

The spacing law of one block edge is applied, as a distribution of arc-length fractions, to every grid line of the block along that axis, and through the seams to the blocks that share a face containing that axis (reversed across a flipped seam), transitively. Every node stays on its line's old polyline and every line keeps its end nodes, so faces across the axis do not move.

The law is taken over the picked edge's arc length: tanh / tanh2 cluster by beta (cluster_at as a fraction), pinned holds first_step and last_step (lengths along the picked edge) around an interior law.

edge_axis function ​

python
edge_axis(edge: str) -> str

source

The axis an edge runs along: the letter its name does not fix.

fractions function ​

python
fractions(spacing: Spacing1D, nodes: np.ndarray) -> np.ndarray

source

Arc-length fractions (n,) of spacing over the polyline nodes (n, 3).

resample function ​

python
resample(lines: np.ndarray, t: np.ndarray) -> np.ndarray

source

Lines (..., n, 3) resampled at arc-length fractions t along themselves.

Collapsed lines (zero length: polar axes) are kept; every line keeps its two end nodes exactly.

plan function ​

python
plan(
    blocks: list[HexBlock],
    block: str,
    edge: str,
    t: np.ndarray,
) -> list[tuple[HexBlock, str, np.ndarray]]

source

Every (block, axis, fractions) the redistribution reaches through seams.

redistribute function ​

python
redistribute(
    blocks: list[HexBlock],
    block: str,
    edge: str,
    spacing: Spacing1D,
) -> list[tuple[str, str]]

source

Apply spacing along edge of block, in place; the (block, axis) changed.

New positions are computed from the old ones for every block before any is written, so blocks sharing seam nodes as views are not resampled twice.

Released under the MIT License.