Asemia
Publish date: Mar 12, 2021
Last updated: Mar 12, 2021
Last updated: Mar 12, 2021
The last version of the grid function I used looks something like this:
def uniform_glyph_baseline(n=10):
pts = [[uniform(-0.4, 0.4), uniform(-0.4, 0.4)],[uniform(-0.4, 0.4), uniform(-0.4, 0.4)]]
for i in range(n):
pts.append([uniform(-0.4, 0.4), uniform(-0.4, 0.4)])
rand_pline = Polyline(pts)
return rand_pline
width = 120
height = 160
d = document(width, height, 'mm')
page = d.addpage()
def brush(a, b, c,d):
return shape().nostroke().fill(rgba(uniform(c, d), 40, uniform(a, b), 160)).width(0.8).join('round')
grid_size = 20
cell_size_x = width / 8
cell_size_y = height / 12
for i in range(grid_size):
for j in range(24):
scale_val = (width / grid_size) * 0.4
x = i+2.1 * cell_size_x + (cell_size_x * uniform(0.2, 1.2)) + uniform(-10, 20)
y = j * cell_size_y + (cell_size_y * 0.4) + uniform(-2, 2)
glyph = uniform_glyph_baseline(4)
glyph = glyph.scale(uniform(6,12)).translate(x, y)
# glyph_curve = glyph.augment().smooth_path(tightness=4)
glyph_curve = glyph.augment().fancy_curve(tightness= -10, samples_per=10, thicknesses=[0.1, 1.1, 0.6, 0.2, 0.8, 1])
# note .path() here, not .polyline()!
page.place(brush(i*12,200-j*20,200-i*12, j*20).polyline(glyph_curve))
show(page)
And several more once I learned that I was using stroke where I may have preferred fill: