Hi all, I’m trying to get this ‘Unknown Pleasures’ cover to generate an SVG without the full vertex paths.
This is the code I’m using, written by someone else:
As you can see it generates full overlapping paths. When I generate an SVG for use with a Pen Plotter, it won’t work. The line output I need has to be like this:
Now I have been looking like crazy everywhere. I don’t own Illustrator, and InkScape is not letting me do what I want. I’m now manually removing line segments in Rhino3D but it’s giving me an intense headache. There must be a way to have the overlapping paths cut each other off. I believe that each next vertex should perform a boolean difference on every previously generated vertex.
I have found that the Geomerative library allows such a thing but have been unsuccessful in finding out exactly how. If this is a lot of work, let me know, I will accept the Rhino3D headache way, but imagine if there is a simple way of getting the result I want, it would’ve been dumb to not at least ask here.
This is the code I edited:
/***************************************************************
Unknown Pleasures
Curves constructed from the actual data from the first
recorded radio pulsar, PSR B1919+21. Artist Peter Saville
saw the image in The Cambridge Encyclopaedia of Astronomy,
and presented a few options to the band. Bernard Sumner
chose PSR B1919+21, and the rest is history.
CSV file contains 80 lines, each containing 300 data points.
License: http://unlicense.org/
***************************************************************/
import processing.svg.*;
PImage img;
void setup() {
size(800,800);
String outfile = "Unknown_Pleasures.svg";
beginRecord(SVG, outfile);
println("press key [r] to save to "+outfile);
}
void draw() {
background(255);
strokeWeight(1);
stroke(0);
noFill();
String[] data = loadStrings("pulsar.csv");
for (int i = 0; i < data.length; i++) {
float[] points = float(split(data[i],','));
beginShape();
for (int j = 0; j < 300; j++) {
vertex(100 + 2 * j, -80 + height - (8 * (79 - i) + 2 * points[j]));
}
endShape();
}
noLoop();
}
void keyPressed() {
if (key == 'r') {
endRecord(); //press the 'r' key to save SVG
}
}
Original source by Michael Kennan for the code is here: