This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Points mover; | |
int docWidth, docHeight; | |
int dpi = 300; //TODO! | |
float scaleFactor = 1; | |
int arrayLength = 300; | |
float minDistance, maxDistance, lineWeightMin, lineWeightMax, circleSizeMin, circleSizeMax; | |
Points[] myArray = new Points[(arrayLength + 3)]; | |
PGraphics imageHolder; | |
void setup() { | |
docWidth = 1300; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String[] sa1 = { "OH ", "NY ", "CA "}; | |
println(sa1); // --> OH, NY, CA | |
println(sa1.length); // --> 3 | |
sa1 = shorten(sa1); | |
println(sa1); // --> OH, NY | |
println(sa1.length); // --> 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int pointsNumber = 300; | |
Points[] pointsArray = new Points[pointsNumber]; | |
class Points { | |
PVector location; | |
float circleSize; | |
float gravity; | |
float lineWeight; | |
color strokeColor; | |
int docHeight = height; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HashGrid { | |
float bucketSize; | |
int gridWidth, gridHeight, bucketLength, numberOfRows, numberOfCols; | |
Buckets[] buckets; | |
HashGrid(float bucketSize_, int gridWidth_, int gridHeight_, int bucketLength_) { | |
bucketSize = bucketSize_; | |
gridWidth = gridWidth_; | |
gridHeight = gridHeight_; | |
bucketLength = bucketLength_; // bucketLength = ceil(10 * (numOfElements / ((gridWidth * gridHeight)/ bucketSize))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HashGrid { | |
float bucketSize; | |
int gridWidth, gridHeight, bucketLength, numberOfRows, numberOfCols; | |
HashGrid(float bucketSize_, int gridWidth_, int gridHeight_, int bucketLength_) { | |
} | |
void set(Points point_) { //TODO: it is better probably to use an interface instead of hardcoding it but for now! ... | |
} | |
Points[] get(PVector location_) { | |
Points[] answer = new Points[answerLength]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HashGrid test; | |
float scaleFactor = 1; | |
void setup(){ | |
size(500, 500); | |
test = new HashGrid(50, width, height, 30); | |
test.drawGrid(); | |
for(int i = 0; i < pointsNumber; i++){ | |
pointsArray[i] = new Points(); | |
test.set(pointsArray[i]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myPath = app.activeDocument.filePath; | |
alert(myPath); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myPath = (app.activeDocument.fullName.parent.fsName).toString().replace(/\\/g, '/'); | |
alert(myPath); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setup(){ | |
ImageIcon titlebaricon = new ImageIcon(loadBytes("myicon.png")); | |
frame.setIconImage(titlebaricon.getImage()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var f = this; | |
var t = ''; | |
var props = f.reflect.properties; | |
for (var i = 0; i < props.length; i++) { | |
t += ('this property ' + props[i].name + ' is ' + f[props[i].name] + "\n"); | |
} | |
alert(t); |
OlderNewer