Molnar

Some works inspired by Vera Molnar.

fill(fullscreen, rgb8(255, 253, 232))

const N = 60
let r = Rect.wh(.95, .95)
let lat = new Lattice(r, N, N)
let filter_func = p => p.row % 4 != 0
let filter_func2 = p => p.row % 4 != 0 && p.col % 4 != 0
let points = lat.points().filter(filter_func2)
let for_dots = new Array(...points)
shuffle(points)

while (points.length > 0) {
    let p = points.pop()
    let ns = lat.neighbors(p.row, p.col, {include_axis_aligned: false})
    ns = ns.filter(filter_func2)
    let n = random_choice(ns)
    stroke(new Line(p.xy, n.xy), black, {width: .001})
}

dots(for_dots.map(v => v.xy), { size: 0.003, color: black })
fill(fullscreen, rgb8(255, 253, 232))

const N = 30
let r = Rect.wh(.95, .95)
let lat = new Lattice(r, N, N)
let points = lat.points()

shuffle(points)

while (points.length > 0) {
    let p = points.pop()
    let ns = lat.neighbors(p.row, p.col, {include_axis_aligned: false})
    let n = random_choice(ns)
    stroke(new Line(p.xy, n.xy), black, {width: .003})
}

dots(lat.points().map(v => v.xy), { size: 0.004, color: black })
const N = 20
let pal = rand_cos_color_palette()

let colors = []
for (let i = 0; i < 10; i ++) {
    colors.push(pal())
}

fill(fullscreen, rgb8(255, 243, 212))
let g = new Grid(Rect.wh(.95, .95), N, N)

for (let c of g.cells()) {
    let r = c.rect
    for (let i = 0; i < 5; i++) {
        if (Math.random() > 0.8) {
            continue
        }
        let s = r.shrink(i * 0.2)
        let col = random_choice(colors)
        stroke(s, col, {
            width: rand_range(0.001, 0.001)
        })
    }
}