morphogen.primitives¶
Explicit geometric primitives: spheres and segments (cylinders or spherocylinders).
These are the “vector” description of grain-based microstructures. Rasterization, signed distances and exports all work from these arrays.
- class morphogen.primitives.Spheres(centers: 'np.ndarray', radii: 'np.ndarray')[source]¶
Bases:
object
- class morphogen.primitives.Segments(start: ndarray, end: ndarray, radii: ndarray, round_caps: bool = True)[source]¶
Bases:
objectCylinders of axis
[start, end]with flat caps, or spherocylinders (round caps).- property lengths: ndarray¶
- property midpoints: ndarray¶
- morphogen.primitives.overlapping_box(prims: Spheres | Segments, lower, upper, margin: float = 0.0) ndarray[source]¶
Mask of the primitives whose bounding box meets
[lower - margin, upper + margin].
- morphogen.primitives.with_periodic_images(prims: Spheres | Segments, domain: Domain, margin: float = 0.0) Spheres | Segments[source]¶
Primitives plus the periodic copies needed to cover the box (and
marginaround).Every primitive whose bounding box, shifted by a combination of box periods, meets the box is added with that shift, so that a non-periodic rasterization of the result over the box equals the periodic microstructure.