p5.js Sketch Link: https://editor.p5js.org/hp3062/full/EWusnjWsM
๐ Description
This sketch procedurally animates a sacred geometry mandala inspired by the cover of Ram Dassโs book Be Here Now. In this iteration, the code is fully refactored into modular "functional units of labor." Instead of crowding the main drawing loop, dedicated custom functions manage specific tasks: updateProgress() tracks animation timing, drawRadialLines() and drawCrossLines() compute geometric vectors, drawDecorations() handles visual accents, and checkReset() monitors loop cycles. This leaves draw() as a clean, high-level conductor directing the flow of labor.
โ๏ธ Short Essay
My Thoughts:
The prompt notes that "our ability to see patterns is what makes us human." At the same time, one of the most challenging tasks for us as humans is simply to "Be Here Now", to remain fully present without getting lost in past regrets or future anxieties. In this assignment, I wanted to use our defining human trait, our instinct for pattern recognition, as a helpful bridge toward achieving that state of presence.
Throughout history, spiritual traditions across the globe have drawn mandalas and repetitive geometric patterns as visual anchors for meditation. By translating Ram Dass's iconic book cover into p5.js, I explored how algorithmic repetition, executed through trigonometric rulesโcan manifest a meditative experience. Furthermore, restructuring the code into distinct "units of labor" mirrored this mindfulness practice. Just as spiritual discipline asks us to declutter our minds to stay present, refactoring the code to keep draw() empty and serene allows each custom function to perform its singular duty with clarity and focus.
๐ Code Highlight 1: The Main Conductor (draw)
Line Number(s): 11โ24
Why it's interesting:
JavaScript
function draw(){
background("#020024");
translate(width / 2, height / 2);
updateProgress(5);
let lineCount = 0;
lineCount = drawRadialLines(lineCount);
lineCount = drawCrossLines(lineCount);
drawDecorations();
checkReset(lineCount, 60);
}
By stripping away raw geometric calculations from draw(), the main function acts purely as an executive conductor delegating tasks to specialized workers. If any single function call is commented out during a class demonstration, its specific "labor" whether timekeeping, web-spinning, or ornamenting, instantly halts, making the architecture completely transparent and modular.