morphogen.models.tpms¶
Triply periodic minimal surface (TPMS) architectures.
- class morphogen.models.tpms.TPMSStructure(domain, surface, variant, level, cell_size, **kwargs)[source]¶
Bases:
MicrostructureSolid
{phi <= level}(network) or{|phi| <= level}(sheet).- 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**3sub-samples per voxel).
- level_set(shape=None, *, voxel_size=None, grid: Grid | None = None) VoxelImage[source]¶
First-order signed distance
(phi - t) / |grad phi|(negative in the solid).
- lipschitz: float = 1.5¶
The first-order distance is a distance near the surface; margin for its curvature
- level_set_at(points, reach: float = inf) ndarray[source]¶
(phi - t) / |grad phi|at the points, aslevel_set().
- class morphogen.models.tpms.TPMS(surface: str = 'gyroid', cell_size: float | tuple = 1.0, variant: str = 'network', level: float | None = None, volume_fraction: float | None = None, *, anisotropy: Anisotropy | None = None)[source]¶
Bases:
ModelTPMS lattice: gyroid, Schwarz P (primitive), Schwarz D (diamond) or Neovius.
network: solid{phi <= level};sheet: solid{|phi| <= level}(walls around the minimal surface). Give the level or the target volume fraction (solid fraction), from which the level is computed on a fine sampling of the unit cell.- phases: ClassVar[dict[int, str]] = {0: 'void', 1: 'solid'}¶
Meaning of the phase indices of the voxel images.
- count_label: ClassVar[str] = 'unit cells'¶
Objects counted by
expected_count()(fibres, spheres, cells…).
- property iso_level: float¶
- generate(domain: Domain, seed: int | SeedSequence | Generator | None = None) TPMSStructure[source]¶
One realization of the model in
domain.