From 36905d62db8c3f66edb4347109c02f16f4222835 Mon Sep 17 00:00:00 2001 From: David Runge Date: Mon, 4 Jan 2016 14:44:39 +0100 Subject: AutoVisual/IGPSquare.pde: Adding greenish color code to the creation of mid level construction lines. Deleting redundant createDividingConstructionLines() function. Renaming createDividingLines() to more declarative createDividingLinesOnOuterSquare(). Creating createVectorIndicatorOnOuterSquare() function for marking PVectors on the outer square, for better debugging. --- AutoVisual/IGPSquare.pde | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/AutoVisual/IGPSquare.pde b/AutoVisual/IGPSquare.pde index 40185cb..bc3cff4 100644 --- a/AutoVisual/IGPSquare.pde +++ b/AutoVisual/IGPSquare.pde @@ -1,5 +1,6 @@ class IGPSquare extends IGPFamily { int parts; + ArrayList vectorsOnOuterSquare; IGPSquare(float x, float y, float d, int p){ super(x, y, d); @@ -51,7 +52,7 @@ class IGPSquare extends IGPFamily { sixteenBaseVectorsOnOuterSquare.add(getVectorOnExtendedLine(mid, alphaCircleVectorsSixteen.get(15), mid.x+radius, false)); } - void createDividingLines(){ + void createDividingLinesOnOuterSquare(){ if(parts == 12){ createLine(twelveBaseVectorsOnOuterSquare.get(0), twelveBaseVectorsOnOuterSquare.get(6)); createLine(twelveBaseVectorsOnOuterSquare.get(1), twelveBaseVectorsOnOuterSquare.get(7)); @@ -71,35 +72,23 @@ class IGPSquare extends IGPFamily { } } - void createDividingConstructionLines(){ - if(parts == 12){ - createLine(twelveBaseVectorsOnOuterSquare.get(0), twelveBaseVectorsOnOuterSquare.get(6)); - createLine(twelveBaseVectorsOnOuterSquare.get(1), twelveBaseVectorsOnOuterSquare.get(7)); - createLine(twelveBaseVectorsOnOuterSquare.get(2), twelveBaseVectorsOnOuterSquare.get(8)); - createLine(twelveBaseVectorsOnOuterSquare.get(3), twelveBaseVectorsOnOuterSquare.get(9)); - createLine(twelveBaseVectorsOnOuterSquare.get(4), twelveBaseVectorsOnOuterSquare.get(10)); - createLine(twelveBaseVectorsOnOuterSquare.get(5), twelveBaseVectorsOnOuterSquare.get(11)); - }else if (parts == 16){ - createLine(sixteenBaseVectorsOnOuterSquare.get(0), sixteenBaseVectorsOnOuterSquare.get(8)); - createLine(sixteenBaseVectorsOnOuterSquare.get(1), sixteenBaseVectorsOnOuterSquare.get(9)); - createLine(sixteenBaseVectorsOnOuterSquare.get(2), sixteenBaseVectorsOnOuterSquare.get(10)); - createLine(sixteenBaseVectorsOnOuterSquare.get(3), sixteenBaseVectorsOnOuterSquare.get(11)); - createLine(sixteenBaseVectorsOnOuterSquare.get(4), sixteenBaseVectorsOnOuterSquare.get(12)); - createLine(sixteenBaseVectorsOnOuterSquare.get(5), sixteenBaseVectorsOnOuterSquare.get(13)); - createLine(sixteenBaseVectorsOnOuterSquare.get(6), sixteenBaseVectorsOnOuterSquare.get(14)); - createLine(sixteenBaseVectorsOnOuterSquare.get(7), sixteenBaseVectorsOnOuterSquare.get(15)); + void createVectorIndicatorOnOuterSquare(float diameter){ + useStrokeColor(); + useFillColor(); + for (PVector vector: vectorsOnOuterSquare){ + createCircle(vector, diameter); } } void displayConstructionLines(){ super.displayConstructionLines(); - createOuterSquare(); - createDiagonalConstructionLinesOnOuterSquare(); - createDividingLines(); + setStrokeColor(new Float[] {0.4, 0.8, 0.4, 1.0}); + setFillColor(new Float[] {0.0, 0.0, 0.0, 0.0}); if (parts == 16){ createInnerSquare(); createInnerSquareTilted(45); } - createDividingConstructionLines(); + createOuterSquare(); + createDividingLinesOnOuterSquare(); } } -- cgit v1.2.3-70-g09d2