GiC (Gestalten in Code) Lang

Back to examples

Law of Clousure and Multistable Perception in a grid

Law of Clousure and Multistable Perception in a grid thumbnail

Adapted from Law of Clousure and Multistable Perception in a grid, created by Edmundo Mejía Galindo.

Matching horizontal and vertical lines compress toward one corner and open into larger cells across the canvas. This seeded GIC adaptation explores shifting perceptions of proximity and depth in a grid.

// ABOUTME: Expands a square grid outward from a densely compressed corner.
// ABOUTME: Demonstrates proximity and multistable depth with geometric spacing.
// Inspired by Edmundo Mejía Galindo's Law of Clousure and Multistable Perception in a grid:
// https://github.com/ff6347/gestalten-in-code/tree/e8b8f8446c13c01494ccfd1e92ce2bb1638daf66/grid/p5js/grid-closure

randomSeed(42);
background("#ffffff");
stroke("#000000");
strokeWidth(0.2);

let x = random(0, 100);
repeat(i, 0, 90) {
	if (x > 0.02) {
		line(0, x, 100, x);
		line(x, 100, x, 0);
		x = x / 1.1;
	}
}