ookey-Interruptions

when looking at Vera Molnar’s piece, these are some assumptions I made:

  • series of equal length black lines
  • lines are on a white square
  • lines are angled in multiple dirrections
  • border of blank space
  • a lot of them seem to face in a similar direction, creating a flow
  • blank “chunks” of lines are removed
  • when two lines on top of each other are aligned vertically, they intersect each other about half way
  • lines are aligned in rows rather than random distribution
  • the chunks being removed don’t have a form to them
  • more lines are distributed horizontally than vertically
  • there are lines missing that aren’t necessarily part of the chunk

This is my “re-coded” version of Interruptions:

When working on this piece, I found myself particularly struggling with removing the lines in a way that resembles Molnar’s original piece.  Part of this is due to the way I created the array of lines.  I first tried to get the lines to resemble the piece and then worked on removing the chunks.  However, because I did not consider the chunks at first, the format I chose made it difficult to create these holes.  I learned to keep future parts of a project in mind as to not limit myself later. Also, throughout the process I found myself impressed by Vera Molnar’s ability to program this in the late 1960s.  It is something I struggled to make using modern and sleeker programming tools, let alone 60s technology.

code:

var rowcol = 50;
var len = 40;
var border = 30;
var lines = [];
 
function setup() { 
  createCanvas(720, 720);
	lines = calclines();
} 
 
function draw() { 
  background('white');
  drawlines();
}
 
function drawlines()
{
  for (i = 0; i < lines.length; i++)
  {
    x1 = lines[i][0];
    y1 = lines[i][1];
    x2 = lines[i][2];
    y2 = lines[i][3];
    hole = lines[i][4];
    if (hole != 0)
    {
   	 line(x1,y1,x2,y2);
    }
  }
}
 
function calclines()
{
	a = [];
  grid = (width - 2 * border) / (rowcol);
  xcenter = border + (grid / 2);
  ycenter = border + (grid / 2);
  for (i = 0; i < (rowcol) * 1.5; i++)
  {
    for (j = 0; j < rowcol; j++)
    {
			xdistance =  random(grid + 5) - (grid / 2);
			x1 = xcenter - xdistance;
			x2 = xcenter + xdistance;
			ydistance = Math.pow( Math.pow(grid / 1.5, 2) - 
													 Math.pow(xdistance, 2)
				, 0.5);
			y1 = ycenter - ydistance;
			y2 = ycenter + ydistance;
      if (a[a.length-1] != undefined 
          && a[a.length-1][4] == 0)
      {
        hole = Math.floor(random(2));
      }
      else if (a[a.length-rowcol] != undefined 
          && a[a.length-rowcol][4]==0)
      {
        hole = Math.floor(random(2));
      }
      else
      {
      	hole = Math.floor(random(100));
      }
      a.push([x1, y1, x2, y2, hole]);
      ycenter += grid;
    }
    ycenter = border + (grid / 2);
    xcenter += (grid / 1.5);
  }
  return a;
}
 
function mouseClicked()
{
  lines = [];
  lines = calclines();
}