Skip to content

Instantly share code, notes, and snippets.

@nataliefreed
nataliefreed / cursorLocator.pde
Created September 3, 2014 02:04
Displays cursor location in Processing
void setup()
{
size(400, 400);
}
void draw()
{
background(255);
fill(0);
text(mouseX + "," + mouseY, 10, 20);
@nataliefreed
nataliefreed / vectorAndBitmapStar.pde
Created September 9, 2014 04:46
This Processing example saves out two images of a star, a PDF (vector) and a PNG (bitmap/raster).
//Art and Science of Computing Fall 14
//This example saves out two images of a star, a PDF (vector) and a PNG (bitmap/raster).
//More PDF export options at: http://processing.org/reference/libraries/pdf/
import processing.pdf.*;
//using two arrays is one improvement on individually naming each point!
int[] xPositions = { 90, 251, 51, 213, 151, 90 };
int[] yPositions = { 230, 112, 112, 229, 39, 230 };
@nataliefreed
nataliefreed / saveCircleClick.pde
Created September 9, 2014 06:14
Circle decreases in size over time. Click mouse to save a "screenshot" of its current state.
//Art and Science of Computing Fall 14
//Circle decreases in size over time
//Click mouse to save a "screenshot" of its current state
float diameter = 200;
void setup()
{
size(300, 300);
strokeWeight(5);
/*
Pompomatic 3000 version 1.0
Natalie Freed, September 10, 2014: initial version including outer slider, percent slider, export button, and on-screen pompom maker preview.
_____________, __________________: ________________________________________________________________________________.
To add yourself as a contributor, please add your name, the date, and a description of your changes/additions.
Inspired by and created for Becca Rose Glowacki's "Pompomology" project, a series of
custom lasercut pompom-makers in different sizes and inner/outer ratios created for
purposes of data collection on various aspects of the pompom production process.
/*
Pompomatic 3000 version 1.0
Natalie Freed, September 10, 2014: initial version including outer slider, percent slider, export button, and on-screen pompom maker preview.
_____________, __________________: ________________________________________________________________________________.
To add yourself as a contributor, please add your name, the date, and a description of your changes/additions. If you add code or ideas
from any other source, include a link and description to give the creator credit, and so others can learn from it too!
Inspired by and created for Becca Rose Glowacki's "Pompomology" project, a series of
void setup()
{
size(300, 300);
//position and draw two triangles in different places
drawMyTriangle(10, 10);
drawMyTriangle(50, 50);
}
//generative rings of diamond shapes
//Natalie Freed Oct. 2014
int numberOfDiamonds; //we will randomize this
float spacingX = 25;
float spacingY = 25;
float diamondWidth; //we will randomize this
float diamondHeight; //we will randomize this
void setup()
//diamonds sprinkled randomly
//Natalie Freed Oct. 2014
int numberOfDiamonds; //we will randomize this
float diamondWidth; //we will randomize this
float diamondHeight; //related to height
void setup()
{
size(500, 500);
//Bezier curve cute blob shapes code generator
//The fancier version!
//Natalie Freed Oct. 2014
DraggableHandler points;
String codeString;
void setup()
{
size(700, 700);