Skip to content

Instantly share code, notes, and snippets.

Avatar

Casey Reas REAS

View GitHub Profile
@REAS
REAS / PDF_Example_02.pde
Last active Oct 12, 2018
Create a PDF file with mouse press
View PDF_Example_02.pde
import processing.pdf.*; // Import PDF code
boolean recordPDF = false;
int count = 0;
void setup() {
size(600, 600);
}
void draw() {
@REAS
REAS / PDF_Example_01.pde
Last active Oct 12, 2018
Create a PDF file and draw to the screen
View PDF_Example_01.pde
import processing.pdf.*; // Import PDF code
void setup() {
size(600, 600);
noLoop(); // Run the draw() only once
}
void draw() {
beginRecord(PDF, "line.pdf"); // Start writing to PDF
// START PATTERN
@REAS
REAS / LatentSpace_to_Diagram_02.pde
Created Sep 11, 2018
Converts a JSON file with values from -1 to 1 into a line of rectangles moving through hues from orange to blue
View LatentSpace_to_Diagram_02.pde
float[] latentspace;
String s = "RandGen_20180904-201026_00036"; // JSON file name
void setup() {
size(1000, 100);
colorMode(HSB, 360, 100, 100);
loadData();
int w = 10;
int h = 100;
for (int i = 0; i < latentspace.length; i++) {
@REAS
REAS / LatentSpace_to_Diagram_01.pde
Last active Sep 10, 2018
Converts a JSON file with values from -1 to 1 into a line of gray rectangles
View LatentSpace_to_Diagram_01.pde
float[] latentspace;
String s = "RandGen_20180904-201026_00036"; // JSON file name
void setup() {
size(1000, 100);
loadData();
int w = 10;
int h = 100;
for (int i = 0; i < latentspace.length; i++) {
float g = map(latentspace[i], -1, 1, 0, 255);
@REAS
REAS / TXT
Last active Feb 1, 2018
Big Picture, SCI-Arc VS 4201 01, Spring 2018
View TXT
Big Picture
SCI-Arc VS 4201 01
Spring 2018
Instructors
Ryan Tyler Martinez
Casey Reas
Course Meetings: Thursdays 10:00-1:00PM, 2:00-5:00pm PC Lab North
View gist:dd67dafe5b26fe35026a55e2e74348d5
import gab.opencv.*;
import processing.video.*;
import java.awt.*;
Capture video;
OpenCV opencv;
void setup() {
size(640, 480);
video = new Capture(this, width, height);
View gist:b08298448524c4d437a4
import processing.pdf.*;
boolean recordFrame = false;
float x;
float diameter;
void setup() {
size(400, 600);
x = random(0, width);
@REAS
REAS / EmbeddedLoops
Created Sep 4, 2014
Embedded Loops for the Buckeyes
View EmbeddedLoops
size(600, 600);
background(255);
strokeWeight(8);
strokeCap(SQUARE);
int offsetRange = 100;
int rowHeight = 10;
for (int y = 0; y < 600; y += rowHeight) {
@REAS
REAS / PDF Example
Last active Aug 29, 2015
PDF Example for the Buckeyes
View PDF Example
import processing.pdf.*;
void setup() {
size(600, 600);
//frameRate(1);
}
void draw() {
beginRecord(PDF, "Ex_07_#######.pdf");
View Grid_textures_01.pde
int gap = 20;
void setup() {
size(1000, 1000);
strokeWeight(4);
strokeCap(SQUARE);
frameRate(0.5);
}
void draw() {