From 54b4b95208bf093af2792ae3be8ecacfa00a8df0 Mon Sep 17 00:00:00 2001 From: David Runge Date: Wed, 30 Dec 2015 20:01:29 +0100 Subject: AutoVisual/IGPSquare.pde: Retabbing document. --- AutoVisual/IGPSquare.pde | 149 ++++++++++++++++++++++++----------------------- 1 file changed, 75 insertions(+), 74 deletions(-) (limited to 'AutoVisual') 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 (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 (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 (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 (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 (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 (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); + } } } -- cgit v1.2.3-70-g09d2