Categories
Generative Gestaltung

Poetry of chalk marks on a black background

Poesie von Kreidestrichen auf schwarzem Grund

Ich machte eine Reise entlang aller Punkte eines Kreises, die durch einen konstanten Radius und einen variablen Winkel definiert ist. Ein magischer Strich bestehend aus einzelnen weißen Punkten wird durch eine Formel berechnet. Durch eine kontinuierliche Drehung um den Mittelpunkt der Zeichnung entsteht ein Muster dass mich an gestenhafte Kreidestriche auf schwarzem Papier erinnert.

Poetry of chalk marks on a black background – I made a trip along all points of a circle, which is defined by a constant radius and a variable angle. A magic line consisting of individual white dots is calculated using a formula. A continuous rotation around the center of the drawing creates a pattern that reminds me of gestural chalk lines on black paper.

Code

https://editor.p5js.org/matthias-jaeger-net/present/iEu3UyM15

/**
 * Poetry of chalk marks on a black background
 * Author: Matthias Jäger
 * Date: 2020-05-04
 */

/** VARIABLES */
// ---------------------------------------------------------------------- //
let angle = 0;
const RADIUS = 400.0;
const TURNS = 2;
const TURN_STEP = 0.1;
const PREASSURE_MAX = 100.0;
const PREASSURE_STEP = 0.1;

/** MAIN */
// ---------------------------------------------------------------------- //

/** setup is executed first */
function setup() {
  // Create a square canvas
  createCanvas(800, 800);

  // Prime the canvas with a dark color
  background(20);
}

/** draw loops over and over */
function draw() {
  // Set the maximum roatation
  const ANGLE_MAX = TURNS * TAU;
  
  // Move to the center of the drawing
  translate(width / 2, height / 2);
  
  // Rotate the drawing by the angle 
  rotate(angle);
  
  // Relate the preassure of the stroke to the angle
  stroke(255, map(angle, 0, ANGLE_MAX, PREASSURE_MAX, 0));
  
  // Perform another loop for each point 
  for (let n = 0; n < PREASSURE_MAX; n += PREASSURE_STEP) {
    const sw = map(n, 0, PREASSURE_MAX, 1, 10);
    const nx = noise(n);
    const x = n * sin(angle * nx);
    const y = noise(angle) * RADIUS;
    strokeWeight(sw);
    point(x, y);
  }
  
  // Start from 0 and increase every frame
  angle += TURN_STEP;
  
  // Check ending condition
  if (angle > ANGLE_MAX) {
    noLoop();
    save("circle-walk.jpg");
  }
}