diff options
author | David Runge <dave@sleepmap.de> | 2015-12-31 03:28:53 +0100 |
---|---|---|
committer | David Runge <dave@sleepmap.de> | 2015-12-31 03:28:53 +0100 |
commit | 434f041585cc1bacac3c90a4c5099d1ea9434ed6 (patch) | |
tree | 403d64f4b8713d09d76db203f56a8c450f05d359 /AutoVisual | |
parent | 54b4b95208bf093af2792ae3be8ecacfa00a8df0 (diff) | |
download | processing-sketchbook-434f041585cc1bacac3c90a4c5099d1ea9434ed6.tar.gz processing-sketchbook-434f041585cc1bacac3c90a4c5099d1ea9434ed6.tar.bz2 processing-sketchbook-434f041585cc1bacac3c90a4c5099d1ea9434ed6.tar.xz processing-sketchbook-434f041585cc1bacac3c90a4c5099d1ea9434ed6.zip |
Separating createDividingLines() creatingDividingConstructionLines()
functionality. Differentiating between amount of parts of square geometric.
Diffstat (limited to 'AutoVisual')
-rw-r--r-- | AutoVisual/IGPSquare.pde | 42 |
1 files changed, 29 insertions, 13 deletions
diff --git a/AutoVisual/IGPSquare.pde b/AutoVisual/IGPSquare.pde index 93f0973..b1e8669 100644 --- a/AutoVisual/IGPSquare.pde +++ b/AutoVisual/IGPSquare.pde @@ -3,7 +3,7 @@ class IGPSquare extends IGPFamily { IGPSquare(float x, float y, float d, int p){ super(x, y, d); -// parts = p; + parts = p; setVectorsOnAlphaCircle(); setConstructionCircleCenters(); setVectorsOnOuterSquare(); @@ -32,7 +32,7 @@ class IGPSquare extends IGPFamily { 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 = 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)); @@ -51,18 +51,36 @@ class IGPSquare extends IGPFamily { constructionPartsSixteen.add(new PVector(constructionCircleCenters.get(1).x-radius/2+radius/amount, mid.y-radius)); } - void createDividingConstructionLines(int amount){ - if(amount == 12){ + void createDividingLines(){ stroke(0.0, 0.66, 0.0, 0.4); + if(parts == 12){ 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); + }else if (parts == 16){ + 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(){ + if(parts == 12){ + 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 (parts == 16){ createLine(constructionPartsSixteen.get(0), constructionPartsSixteen.get(8)); createLine(constructionPartsSixteen.get(1), constructionPartsSixteen.get(9)); createLine(constructionPartsSixteen.get(2), constructionPartsSixteen.get(10)); @@ -77,18 +95,16 @@ class IGPSquare extends IGPFamily { void display() { super.display(); createOuterSquare(); - if (parts == 16){ - createInnerSquare(); - createInnerSquareTilted(45); - } + createDividingLines(); } void displayConstructionLines(){ super.displayConstructionLines(); createDiagonalConstructionLines(); - createDividingConstructionLines(12); if (parts == 16){ - createDividingConstructionLines(16); + createInnerSquare(); + createInnerSquareTilted(45); } + createDividingConstructionLines(); } } |