diff options
-rw-r--r-- | AutoVisual/IGPHexagon.pde | 111 |
1 files changed, 66 insertions, 45 deletions
diff --git a/AutoVisual/IGPHexagon.pde b/AutoVisual/IGPHexagon.pde index 8c2c5ab..bc90a4d 100644 --- a/AutoVisual/IGPHexagon.pde +++ b/AutoVisual/IGPHexagon.pde @@ -1,10 +1,30 @@ class IGPHexagon extends IGPFamily{ + ArrayList <PVector> baseVectorsOnInnerHexagon; + ArrayList <PVector> baseVectorsOnConstructionCircles; + ArrayList <PVector> vectorsOnInnerHexagon; + IGPHexagon(float x, float y, float d){ super(x, y, d); - setVectorsOnAlphaCircle(); + setBaseVectorsOnInnerHexagon(); setConstructionCircleCenters(); - setVectorsOnConstructionCircles(); + setBaseVectorsOnConstructionCircles(); + } + + void setBaseVectorsOnInnerHexagon(){ + baseVectorsOnInnerHexagon = new ArrayList <PVector> (12); + baseVectorsOnInnerHexagon.add(getLineIntersection(alphaCircleVectors.get(11), alphaCircleVectors.get(1), mid, alphaCircleVectors.get(0))); + baseVectorsOnInnerHexagon.add(alphaCircleVectors.get(1)); + baseVectorsOnInnerHexagon.add(getLineIntersection(alphaCircleVectors.get(1), alphaCircleVectors.get(3), mid, alphaCircleVectors.get(2))); + baseVectorsOnInnerHexagon.add(alphaCircleVectors.get(3)); + baseVectorsOnInnerHexagon.add(getLineIntersection(alphaCircleVectors.get(3), alphaCircleVectors.get(5), mid, alphaCircleVectors.get(4))); + baseVectorsOnInnerHexagon.add(alphaCircleVectors.get(5)); + baseVectorsOnInnerHexagon.add(getLineIntersection(alphaCircleVectors.get(5), alphaCircleVectors.get(7), mid, alphaCircleVectors.get(6))); + baseVectorsOnInnerHexagon.add(alphaCircleVectors.get(7)); + baseVectorsOnInnerHexagon.add(getLineIntersection(alphaCircleVectors.get(7), alphaCircleVectors.get(9), mid, alphaCircleVectors.get(8))); + baseVectorsOnInnerHexagon.add(alphaCircleVectors.get(9)); + baseVectorsOnInnerHexagon.add(getLineIntersection(alphaCircleVectors.get(9), alphaCircleVectors.get(11), mid, alphaCircleVectors.get(10))); + baseVectorsOnInnerHexagon.add(alphaCircleVectors.get(11)); } void setConstructionCircleCenters(){ @@ -17,57 +37,58 @@ class IGPHexagon extends IGPFamily{ constructionCircleCenters.add(alphaCircleVectors.get(10)); } - void setVectorsOnConstructionCircles(){ - int amount = 12; - twelveBaseVectorsOnOuterSquare = new ArrayList <PVector>(12); - // 0° - twelveBaseVectorsOnOuterSquare.add(getVectorOnCircle(constructionCircleCenters.get(0), 0)); - // 30° - twelveBaseVectorsOnOuterSquare.add(getVectorOnCircle(constructionCircleCenters.get(1), 0)); - // 60° - twelveBaseVectorsOnOuterSquare.add(getVectorOnCircle(constructionCircleCenters.get(1), 60)); - // 90° - twelveBaseVectorsOnOuterSquare.add(getVectorOnCircle(constructionCircleCenters.get(1), 120)); - // 120° - twelveBaseVectorsOnOuterSquare.add(getVectorOnCircle(constructionCircleCenters.get(2), 120)); - // 150° - twelveBaseVectorsOnOuterSquare.add(getVectorOnCircle(constructionCircleCenters.get(3), 120)); - // 180° - twelveBaseVectorsOnOuterSquare.add(getVectorOnCircle(constructionCircleCenters.get(3), 180)); - // 210° - twelveBaseVectorsOnOuterSquare.add(getVectorOnCircle(constructionCircleCenters.get(4), 180)); - // 240° - twelveBaseVectorsOnOuterSquare.add(getVectorOnCircle(constructionCircleCenters.get(4), 240)); - // 270° - twelveBaseVectorsOnOuterSquare.add(getVectorOnCircle(constructionCircleCenters.get(4), 300)); - // 300° - twelveBaseVectorsOnOuterSquare.add(getVectorOnCircle(constructionCircleCenters.get(5), 300)); - // 330° - twelveBaseVectorsOnOuterSquare.add(getVectorOnCircle(constructionCircleCenters.get(5), 0)); + void setBaseVectorsOnConstructionCircles(){ + baseVectorsOnConstructionCircles = new ArrayList <PVector>(12); + baseVectorsOnConstructionCircles.add(getVectorOnCircle(constructionCircleCenters.get(0), 0)); + baseVectorsOnConstructionCircles.add(getVectorOnCircle(constructionCircleCenters.get(1), 0)); + baseVectorsOnConstructionCircles.add(getVectorOnCircle(constructionCircleCenters.get(1), 60)); + baseVectorsOnConstructionCircles.add(getVectorOnCircle(constructionCircleCenters.get(1), 120)); + baseVectorsOnConstructionCircles.add(getVectorOnCircle(constructionCircleCenters.get(2), 120)); + baseVectorsOnConstructionCircles.add(getVectorOnCircle(constructionCircleCenters.get(3), 120)); + baseVectorsOnConstructionCircles.add(getVectorOnCircle(constructionCircleCenters.get(3), 180)); + baseVectorsOnConstructionCircles.add(getVectorOnCircle(constructionCircleCenters.get(4), 180)); + baseVectorsOnConstructionCircles.add(getVectorOnCircle(constructionCircleCenters.get(4), 240)); + baseVectorsOnConstructionCircles.add(getVectorOnCircle(constructionCircleCenters.get(4), 300)); + baseVectorsOnConstructionCircles.add(getVectorOnCircle(constructionCircleCenters.get(5), 300)); + baseVectorsOnConstructionCircles.add(getVectorOnCircle(constructionCircleCenters.get(5), 0)); + } + + void createDividingLinesOnConstructionCircles(){ + useStrokeColor(); + useFillColor(); + createLine(baseVectorsOnConstructionCircles.get(0), baseVectorsOnConstructionCircles.get(6)); + createLine(baseVectorsOnConstructionCircles.get(1), baseVectorsOnConstructionCircles.get(7)); + createLine(baseVectorsOnConstructionCircles.get(2), baseVectorsOnConstructionCircles.get(8)); + createLine(baseVectorsOnConstructionCircles.get(3), baseVectorsOnConstructionCircles.get(9)); + createLine(baseVectorsOnConstructionCircles.get(4), baseVectorsOnConstructionCircles.get(10)); + createLine(baseVectorsOnConstructionCircles.get(5), baseVectorsOnConstructionCircles.get(11)); } - void createDividingConstructionLines(int amount){ - 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)); + void createDividingLinesOnInnerHexagon(){ + useStrokeColor(); + useFillColor(); + createLine(baseVectorsOnInnerHexagon.get(0), baseVectorsOnInnerHexagon.get(6)); + createLine(baseVectorsOnInnerHexagon.get(1), baseVectorsOnInnerHexagon.get(7)); + createLine(baseVectorsOnInnerHexagon.get(2), baseVectorsOnInnerHexagon.get(8)); + createLine(baseVectorsOnInnerHexagon.get(3), baseVectorsOnInnerHexagon.get(9)); + createLine(baseVectorsOnInnerHexagon.get(4), baseVectorsOnInnerHexagon.get(10)); + createLine(baseVectorsOnInnerHexagon.get(5), baseVectorsOnInnerHexagon.get(11)); } - void createDividingLines(int amount){ - createLine(alphaCircleVectors.get(0), alphaCircleVectors.get(6)); - createLine(alphaCircleVectors.get(1), alphaCircleVectors.get(7)); - createLine(alphaCircleVectors.get(2), alphaCircleVectors.get(8)); - createLine(alphaCircleVectors.get(3), alphaCircleVectors.get(9)); - createLine(alphaCircleVectors.get(4), alphaCircleVectors.get(10)); - createLine(alphaCircleVectors.get(5), alphaCircleVectors.get(11)); + void createVectorIndicatorOnInnerHexagon(float diameter){ + useStrokeColor(); + useFillColor(); + for (PVector vector: vectorsOnInnerHexagon){ + createCircle(vector, diameter); + } } void displayConstructionLines(){ super.displayConstructionLines(); - createDividingLines(12); + createDividingLinesOnConstructionCircles(); + setStrokeColor(new Float[] {0.4, 0.8, 0.4, 1.0}); + setFillColor(new Float[] {0.0, 0.0, 0.0, 0.0}); + createDividingLinesOnInnerHexagon(); createInnerHexagon(); - createDividingConstructionLines(12); } } |