morphogen.models.honeycomb

Honeycombs and wood: prismatic cells with walls.

Prismatic cellular solids, the honeycombs of bees and the cells of wood, of cork or of plant stems, are stiff and strong along their axis for their weight, and compliant across it (Gibson and Ashby 1997). The model extrudes along an axis a tessellation of the plane of germs whose cells are bounded by walls of thickness t: the points of a cell closer than t / 2 to its sides (a wall between two cells is the sum of their halves). The germs are

  • hexagonal or square: lattices whose cells are hexagons d wide between opposite walls, or squares of side d, displaced at random by up to disorder cell (a periodic box holds whole cells: the lattice stretches to fit it);

  • voronoi: points of a random sequential addition at least regularity jamming distance apart (Poisson points for 0), one per area sqrt(3) d^2 / 2 of a hexagon;

  • wood: the radial files of softwoods, rectangular cells rather than the cells of germs. Along the tangential axis (the second of the plane), files d wide whose radial walls are straight; along the radial axis (the first), cells whose size and wall thickness vary through the growth rings of width ring_width: from large thin-walled earlywood cells (d across) to small thick-walled latewood cells (latewood_size and latewood_wall times those of earlywood, in the last latewood_fraction of the ring, after a transition of half that width); each file is shifted by a random fraction of its cells, so that the tangential walls are staggered. Loaded radially, the straight radial walls carry the load; tangentially, the radial walls bend between the staggered tangential ones: with uniform cells the radial modulus is several times the tangential one. Dense latewood bands, continuous along the tangential axis, stiffen it.

    Rays (ray_fraction of the volume) are ribbons of parenchyma cells that run radially across the rings between two files: ray_width cells across (1: the uniseriate rays of softwoods, more for the multiseriate rays of hardwoods) and ray_height high along the grain, at random places, never closer than one ray cell along the grain to another ray between the same files or between neighbouring ones. Their cells are boxes ray_cell_length long radially, ray_cell_width wide and ray_cell_height high, with walls ray_wall thick. The tracheids pass beside the rays: over the height of a ray, its walls replace the radial wall between the two files, narrowed by half its width each. Rays make the structure three-dimensional.

Walls of uniform thickness t around hexagons or squares of width d take the fraction 1 - (1 - t / d)^2 of the volume, exactly; around the cells of Poisson germs, t L_A = 2 t sqrt(lambda) to first order in t (L_A: length of the sides per unit area, lambda: germs per unit area).

class morphogen.models.honeycomb.RadialFiles(origin, width, bounds, lengths, periodic: bool, lower)[source]

Bases: object

Rectangular cells in files along the first axis of the plane: file j spans [origin + j width, origin + (j + 1) width) across, its cells the intervals between its consecutive bounds[j] along it (on a periodic box, one period: the last bound is the first plus the length of the box).

property n_files: int
parts(points)[source]

Cell and file j of each point, and its distances to the sides of the cell: along the file, and across it to its radial walls below and above (on the boundaries j and j + 1 of the files).

above(j: ndarray) → ndarray[source]

Boundary above the files j (the first one again on a periodic box).

locate(points, reach: float = inf) → tuple[ndarray, ndarray][source]

Cell of each point and its distance to the sides of the cell (exact).

class morphogen.models.honeycomb.WoodRays(boundary, z, u, cells, width, height, cell_length, cell_height, thickness, period=None)[source]

Bases: object

Rays between radial files: ray r lies on the boundary boundary[r] of the files (the radial wall between the files boundary[r] - 1 and boundary[r]), width wide across it, from z[r] to z[r] + height along the grain (the prism axis, of period on a periodic box). Its cells are boxes cell_length long radially (their boundaries at u[r] plus multiples of it), width / cells wide and cell_height high, with walls thickness thick.

locate(boundary: ndarray, z: ndarray)[source]

For points given by a boundary of the files and their coordinate along the grain: the ray on the boundary at their height (-1: none), their height in it, and their distance along the grain to the rays of the boundary (0 within the height of one, inf: none).

cell_distance(ray: ndarray, u: ndarray, rel: ndarray, across)[source]

Distance of points in rays to the walls of their cells: radially, along the grain and across (across: the position of the points across their ray, from 0 to its width).

to_dict() → dict[source]
class morphogen.models.honeycomb.PrismaticCells(domain, axis, germs, walls, files=None, **kwargs)[source]

Bases: Microstructure

Prisms along axis over cells of the plane: the walls (phase 1) are the points closer to the sides of their cell than half its wall thickness walls[i], the lumens of the cells phase 0. The cells are those of germs (Voronoi), or rectangles in radial files (wood; the germs are then their centres), between which rays may run (files["rays"], WoodRays): the structure is then three-dimensional.

property n_cells: int
property n_rays: int
property ray_fraction: float

rays run across the box radially, so that it is their share of the tangential plane (across the files and along the grain).

Type:

Fraction of the box in rays (their cells and walls), exact

contains(points) → ndarray[source]

Whether points lie in phase 1.

level_set_at(points, reach: float = inf) → ndarray[source]

The distance to the sides of the cells minus half their walls at the points (exact within reach of the walls, at least reach beyond).

voxelize(shape=None, *, voxel_size=None, grid: Grid | None = None, supersampling=1)[source]

Phase image (uint8), or partial volume fractions of phase 1 (float32) when supersampling > 1 (supersampling**3 sub-samples per voxel).

level_set(shape=None, *, voxel_size=None, grid: Grid | None = None) → VoxelImage[source]

Distance to the sides of the cells minus half their walls: negative in the walls, the signed distance to them near their faces.

summary() → dict[source]

Counts and sizes describing the realization.

class morphogen.models.honeycomb.Honeycomb(cell_size: float = 1.0, wall_thickness: float = 0.1, arrangement: str = 'hexagonal', regularity: float = 0.7, disorder: float = 0.0, ring_width: float | None = None, latewood_fraction: float = 0.3, latewood_size: float = 0.4, latewood_wall: float = 2.0, ray_fraction: float = 0.0, ray_width: int = 1, ray_height: float | None = None, ray_cell_length: float | None = None, ray_cell_width: float | None = None, ray_cell_height: float | None = None, ray_wall: float | None = None, axis: int = 2)[source]

Bases: Model

Prismatic cells along axis with walls of wall_thickness: hexagonal or square honeycombs, random cells, or the radial files, growth rings and rays of wood.

phases: ClassVar[dict[int, str]] = {0: 'cells', 1: 'walls'}

Meaning of the phase indices of the voxel images.

count_label: ClassVar[str] = 'cells'

Objects counted by expected_count() (fibres, spheres, cells…).

property ray_cells: dict[str, float]

Sizes of the ray cells (cell_length, cell_width, cell_height) and of the rays (width, height), and the thickness of their walls.

ring_profile(x: ndarray) → ndarray[source]

Latewood share at the positions x (in rings, from the start of a ring): 0 in earlywood, 1 in latewood, linear through the transition.

generate(domain: Domain, seed: int | SeedSequence | Generator | None = None) → PrismaticCells[source]

One realization of the model in domain.

property cell_area: float
expected_count(domain: Domain) → float[source]

Mean number of cells across the domain.

theory(domain: Domain | None = None) → dict[str, float][source]

Theoretical morphological characteristics known in closed form (may be empty).

Some values depend on the domain (e.g. the intensity implied by a number of cells).