summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Runge <dave@sleepmap.de>2015-12-30 20:01:29 +0100
committerDavid Runge <dave@sleepmap.de>2015-12-30 20:01:29 +0100
commit54b4b95208bf093af2792ae3be8ecacfa00a8df0 (patch)
treed40bb9a6da31d83ec714cb0670d8da175faaf8cc
parent887a2b02cec9c2630437e862393176b06de0f79b (diff)
downloadprocessing-sketchbook-54b4b95208bf093af2792ae3be8ecacfa00a8df0.tar.gz
processing-sketchbook-54b4b95208bf093af2792ae3be8ecacfa00a8df0.tar.bz2
processing-sketchbook-54b4b95208bf093af2792ae3be8ecacfa00a8df0.tar.xz
processing-sketchbook-54b4b95208bf093af2792ae3be8ecacfa00a8df0.zip
AutoVisual/IGPSquare.pde: Retabbing document.
-rw-r--r--AutoVisual/IGPSquare.pde149
1 files changed, 75 insertions, 74 deletions
diff --git a/AutoVisual/IGPSquare.pde b/AutoVisual/IGPSquare.pde
index 88d6e14..93f0973 100644
--- a/AutoVisual/IGPSquare.pde
+++ b/AutoVisual/IGPSquare.pde
@@ -1,93 +1,94 @@
class IGPSquare extends IGPFamily {
- int parts;
+ int parts;
IGPSquare(float x, float y, float d, int p){
- super(x, y, d);
-// parts = p;
+ super(x, y, d);
+// parts = p;
setVectorsOnAlphaCircle();
setConstructionCircleCenters();
- setVectorsOnOuterSquare();
+ setVectorsOnOuterSquare();
}
- void setConstructionCircleCenters(){
- constructionCircleCenters = new ArrayList <PVector> (4);
- constructionCircleCenters.add(alphaCircleVectors.get(0));
- constructionCircleCenters.add(alphaCircleVectors.get(3));
- constructionCircleCenters.add(alphaCircleVectors.get(6));
- constructionCircleCenters.add(alphaCircleVectors.get(9));
- }
+ void setConstructionCircleCenters(){
+ constructionCircleCenters = new ArrayList <PVector> (4);
+ constructionCircleCenters.add(alphaCircleVectors.get(0));
+ constructionCircleCenters.add(alphaCircleVectors.get(3));
+ constructionCircleCenters.add(alphaCircleVectors.get(6));
+ constructionCircleCenters.add(alphaCircleVectors.get(9));
+ }
- void setVectorsOnOuterSquare(){
- int amount = 12;
- constructionPartsTwelve = new ArrayList <PVector>(12);
- constructionPartsTwelve.add(constructionCircleCenters.get(0));
- constructionPartsTwelve.add(new PVector(constructionCircleCenters.get(1).x+radius/2+radius/amount, mid.y-radius));
- constructionPartsTwelve.add(new PVector(mid.x+radius, constructionCircleCenters.get(0).y-radius/2-radius/amount));
- constructionPartsTwelve.add(constructionCircleCenters.get(1));
- constructionPartsTwelve.add(new PVector(mid.x+radius, constructionCircleCenters.get(0).y+radius/2+radius/amount));
- constructionPartsTwelve.add(new PVector(constructionCircleCenters.get(3).x+radius/2+radius/amount, mid.y+radius));
- constructionPartsTwelve.add(constructionCircleCenters.get(2));
- constructionPartsTwelve.add(new PVector(constructionCircleCenters.get(3).x-radius/2-radius/amount, mid.y+radius));
- constructionPartsTwelve.add(new PVector(mid.x-radius, constructionCircleCenters.get(2).y+radius/2+radius/amount));
- constructionPartsTwelve.add(constructionCircleCenters.get(3));
- constructionPartsTwelve.add(new PVector(mid.x-radius, constructionCircleCenters.get(2).y-radius/2-radius/amount));
- constructionPartsTwelve.add(new PVector(constructionCircleCenters.get(1).x-radius/2-radius/amount, mid.y-radius));
- constructionPartsSixteen = new ArrayList <PVector>(16);
- constructionPartsSixteen.add(constructionCircleCenters.get(0));
- constructionPartsSixteen.add(new PVector(constructionCircleCenters.get(1).x+radius/2-radius/amount, mid.y-radius));
- constructionPartsSixteen.add(new PVector(constructionCircleCenters.get(1).x-radius, constructionCircleCenters.get(2).y-radius));
- constructionPartsSixteen.add(new PVector(mid.x+radius, constructionCircleCenters.get(0).y-radius/2+radius/amount));
- constructionPartsSixteen.add(constructionCircleCenters.get(1));
- constructionPartsSixteen.add(new PVector(mid.x+radius, constructionCircleCenters.get(0).y+radius/2-radius/amount));
- constructionPartsSixteen.add(new PVector(constructionCircleCenters.get(1).x+radius, constructionCircleCenters.get(0).y-radius));
- constructionPartsSixteen.add(new PVector(constructionCircleCenters.get(3).x+radius/2-radius/amount, mid.y+radius));
- constructionPartsSixteen.add(constructionCircleCenters.get(2));
- constructionPartsSixteen.add(new PVector(constructionCircleCenters.get(3).x-radius/2+radius/amount, mid.y+radius));
- constructionPartsSixteen.add(new PVector(constructionCircleCenters.get(3).x+radius, constructionCircleCenters.get(0).y+radius));
- constructionPartsSixteen.add(new PVector(mid.x-radius, constructionCircleCenters.get(2).y+radius/2-radius/amount));
- constructionPartsSixteen.add(constructionCircleCenters.get(3));
- constructionPartsSixteen.add(new PVector(mid.x-radius, constructionCircleCenters.get(2).y-radius/2+radius/amount));
- constructionPartsSixteen.add(new PVector(constructionCircleCenters.get(3).x-radius, constructionCircleCenters.get(2).y+radius));
- constructionPartsSixteen.add(new PVector(constructionCircleCenters.get(1).x-radius/2+radius/amount, mid.y-radius));
- }
+ void setVectorsOnOuterSquare(){
+ int amount = 12;
+ constructionPartsTwelve = new ArrayList <PVector>(12);
+ constructionPartsTwelve.add(constructionCircleCenters.get(0));
+ constructionPartsTwelve.add(new PVector(constructionCircleCenters.get(1).x+radius/2+radius/amount, mid.y-radius));
+ constructionPartsTwelve.add(new PVector(mid.x+radius, constructionCircleCenters.get(0).y-radius/2-radius/amount));
+ constructionPartsTwelve.add(constructionCircleCenters.get(1));
+ constructionPartsTwelve.add(new PVector(mid.x+radius, constructionCircleCenters.get(0).y+radius/2+radius/amount));
+ constructionPartsTwelve.add(new PVector(constructionCircleCenters.get(3).x+radius/2+radius/amount, mid.y+radius));
+ constructionPartsTwelve.add(constructionCircleCenters.get(2));
+ constructionPartsTwelve.add(new PVector(constructionCircleCenters.get(3).x-radius/2-radius/amount, mid.y+radius));
+ constructionPartsTwelve.add(new PVector(mid.x-radius, constructionCircleCenters.get(2).y+radius/2+radius/amount));
+ constructionPartsTwelve.add(constructionCircleCenters.get(3));
+ constructionPartsTwelve.add(new PVector(mid.x-radius, constructionCircleCenters.get(2).y-radius/2-radius/amount));
+ constructionPartsTwelve.add(new PVector(constructionCircleCenters.get(1).x-radius/2-radius/amount, mid.y-radius));
+ constructionPartsSixteen = new ArrayList <PVector>(16);
+ constructionPartsSixteen.add(constructionCircleCenters.get(0));
+ constructionPartsSixteen.add(new PVector(constructionCircleCenters.get(1).x+radius/2-radius/amount, mid.y-radius));
+ constructionPartsSixteen.add(new PVector(constructionCircleCenters.get(1).x-radius, constructionCircleCenters.get(2).y-radius));
+ constructionPartsSixteen.add(new PVector(mid.x+radius, constructionCircleCenters.get(0).y-radius/2+radius/amount));
+ constructionPartsSixteen.add(constructionCircleCenters.get(1));
+ constructionPartsSixteen.add(new PVector(mid.x+radius, constructionCircleCenters.get(0).y+radius/2-radius/amount));
+ constructionPartsSixteen.add(new PVector(constructionCircleCenters.get(1).x+radius, constructionCircleCenters.get(0).y-radius));
+ constructionPartsSixteen.add(new PVector(constructionCircleCenters.get(3).x+radius/2-radius/amount, mid.y+radius));
+ constructionPartsSixteen.add(constructionCircleCenters.get(2));
+ constructionPartsSixteen.add(new PVector(constructionCircleCenters.get(3).x-radius/2+radius/amount, mid.y+radius));
+ constructionPartsSixteen.add(new PVector(constructionCircleCenters.get(3).x+radius, constructionCircleCenters.get(0).y+radius));
+ constructionPartsSixteen.add(new PVector(mid.x-radius, constructionCircleCenters.get(2).y+radius/2-radius/amount));
+ constructionPartsSixteen.add(constructionCircleCenters.get(3));
+ constructionPartsSixteen.add(new PVector(mid.x-radius, constructionCircleCenters.get(2).y-radius/2+radius/amount));
+ constructionPartsSixteen.add(new PVector(constructionCircleCenters.get(3).x-radius, constructionCircleCenters.get(2).y+radius));
+ constructionPartsSixteen.add(new PVector(constructionCircleCenters.get(1).x-radius/2+radius/amount, mid.y-radius));
+ }
- void createDividingConstructionLines(int amount){
- if(amount == 12){
- stroke(0.0, 0.66, 0.0, 0.4);
- createLine(constructionPartsTwelve.get(0), constructionPartsTwelve.get(6));
- createLine(constructionPartsTwelve.get(1), constructionPartsTwelve.get(7));
- createLine(constructionPartsTwelve.get(2), constructionPartsTwelve.get(8));
- createLine(constructionPartsTwelve.get(3), constructionPartsTwelve.get(9));
- createLine(constructionPartsTwelve.get(4), constructionPartsTwelve.get(10));
- createLine(constructionPartsTwelve.get(5), constructionPartsTwelve.get(11));
- }else if (amount == 16){
- amount = 12;
- stroke(0.0, 0.0, 0.66, 0.4);
- createLine(constructionPartsSixteen.get(0), constructionPartsSixteen.get(8));
- createLine(constructionPartsSixteen.get(1), constructionPartsSixteen.get(9));
- createLine(constructionPartsSixteen.get(2), constructionPartsSixteen.get(10));
- createLine(constructionPartsSixteen.get(3), constructionPartsSixteen.get(11));
- createLine(constructionPartsSixteen.get(4), constructionPartsSixteen.get(12));
- createLine(constructionPartsSixteen.get(5), constructionPartsSixteen.get(13));
- createLine(constructionPartsSixteen.get(6), constructionPartsSixteen.get(14));
- createLine(constructionPartsSixteen.get(7), constructionPartsSixteen.get(15));
- }
- }
+ void createDividingConstructionLines(int amount){
+ if(amount == 12){
+ stroke(0.0, 0.66, 0.0, 0.4);
+ createLine(constructionPartsTwelve.get(0), constructionPartsTwelve.get(6));
+ createLine(constructionPartsTwelve.get(1), constructionPartsTwelve.get(7));
+ createLine(constructionPartsTwelve.get(2), constructionPartsTwelve.get(8));
+ createLine(constructionPartsTwelve.get(3), constructionPartsTwelve.get(9));
+ createLine(constructionPartsTwelve.get(4), constructionPartsTwelve.get(10));
+ createLine(constructionPartsTwelve.get(5), constructionPartsTwelve.get(11));
+ }else if (amount == 16){
+ amount = 12;
+ stroke(0.0, 0.0, 0.66, 0.4);
+ createLine(constructionPartsSixteen.get(0), constructionPartsSixteen.get(8));
+ createLine(constructionPartsSixteen.get(1), constructionPartsSixteen.get(9));
+ createLine(constructionPartsSixteen.get(2), constructionPartsSixteen.get(10));
+ createLine(constructionPartsSixteen.get(3), constructionPartsSixteen.get(11));
+ createLine(constructionPartsSixteen.get(4), constructionPartsSixteen.get(12));
+ createLine(constructionPartsSixteen.get(5), constructionPartsSixteen.get(13));
+ createLine(constructionPartsSixteen.get(6), constructionPartsSixteen.get(14));
+ createLine(constructionPartsSixteen.get(7), constructionPartsSixteen.get(15));
+ }
+ }
void display() {
super.display();
createOuterSquare();
- if (parts == 16){
- createInnerSquare();
- createInnerSquareTilted(45);
- }
+ if (parts == 16){
+ createInnerSquare();
+ createInnerSquareTilted(45);
+ }
}
+
void displayConstructionLines(){
super.displayConstructionLines();
createDiagonalConstructionLines();
- createDividingConstructionLines(12);
- if (parts == 16){
- createDividingConstructionLines(16);
- }
+ createDividingConstructionLines(12);
+ if (parts == 16){
+ createDividingConstructionLines(16);
+ }
}
}