patterns — windrows

generator verdict no votes yet
source — auto/a003_windrows.g53_windrows
def g53_windrows(rng):
    """WINDROWS — anisotropic scaling: each lattice mark is a rectangle stretched
    along a smooth direction field, its stretch ratio set by a second noise
    channel so combed regions run long and calm regions stay near square."""
    N = rng.choice([24, 32, 40, 50])
    c = Canvas(N, "GEOMETRIC", "squares", "windrows", tiles=False)
    C = c.C
    ang_noise = Value2D(rng, res=rng.choice([2, 3, 4]))
    mag_noise = Value2D(rng, res=rng.choice([3, 4, 5]))
    ang_scale = rng.uniform(1.2, 2.4)
    base_ang = rng.uniform(0, 360)
    thick = rng.uniform(0.34, 0.52) * C
    stretch_min = rng.uniform(1.1, 1.6)
    stretch_max = rng.uniform(2.2, 3.4)
    for i in range(N):
        for j in range(N):
            u, v = (i + 0.5) / N, (j + 0.5) / N
            theta = base_ang + (ang_noise(u, v) - 0.5) * 360 * ang_scale
            m = mag_noise(u, v)
            stretch = stretch_min + (stretch_max - stretch_min) * m
            length = thick * stretch
            x, y = c.center(i, j)
            c.rect(x, y, thick, length, rot=theta)
    return c
windrows-squares-32-1aab
windrows-squares-32-1aab
windrows-squares-40-f3ba
windrows-squares-40-f3ba
windrows-squares-40-d7aa
windrows-squares-40-d7aa
windrows-squares-50-3bfd
windrows-squares-50-3bfd
windrows-squares-40-3115
windrows-squares-40-3115
windrows-squares-40-e89a
windrows-squares-40-e89a
windrows-squares-24-eee4
windrows-squares-24-eee4 erica ✕
windrows-squares-50-39da
windrows-squares-50-39da
windrows-squares-50-5501
windrows-squares-50-5501

generator