From 33a44587ecf9c6b2287b460743207f856f811067 Mon Sep 17 00:00:00 2001 From: David Runge Date: Wed, 30 Dec 2015 03:43:22 +0100 Subject: AutoVisual: First commit of AutoVisual, a sketch based upon Islamic Geometric Patterns by Eric Broug. Partially functioning implementations of square, pentagon and hexagon base patterns. --- AutoVisual/IGPHexagon.pde | 96 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 AutoVisual/IGPHexagon.pde (limited to 'AutoVisual/IGPHexagon.pde') diff --git a/AutoVisual/IGPHexagon.pde b/AutoVisual/IGPHexagon.pde new file mode 100644 index 0000000..aeb4164 --- /dev/null +++ b/AutoVisual/IGPHexagon.pde @@ -0,0 +1,96 @@ +class IGPHexagon extends IGPFamily{ + + IGPHexagon(float x, float y, float d){ + super(x, y, d); + setVectorsOnAlphaCircle(); + setVectorsOnConstructionCircles(); + } + + void setVectorsOnConstructionCircles(){ + int amount = 12; + constructionPartsTwelve = new ArrayList (12); + // 0° + constructionPartsTwelve.add(getVectorOnCircle(constructionCircleCenters.get(0), 0)); + // 30° + constructionPartsTwelve.add(getVectorOnCircle(constructionCircleCenters.get(2), 0)); + // 60° + constructionPartsTwelve.add(getVectorOnCircle(constructionCircleCenters.get(2), 60)); + // 90° + constructionPartsTwelve.add(getVectorOnCircle(constructionCircleCenters.get(2), 120)); + // 120° + constructionPartsTwelve.add(getVectorOnCircle(constructionCircleCenters.get(4), 120)); + // 150° + constructionPartsTwelve.add(getVectorOnCircle(constructionCircleCenters.get(6), 120)); + // 180° + constructionPartsTwelve.add(getVectorOnCircle(constructionCircleCenters.get(6), 180)); + // 210° + constructionPartsTwelve.add(getVectorOnCircle(constructionCircleCenters.get(8), 180)); + // 240° + constructionPartsTwelve.add(getVectorOnCircle(constructionCircleCenters.get(8), 240)); + // 270° + constructionPartsTwelve.add(getVectorOnCircle(constructionCircleCenters.get(8), 300)); + // 300° + constructionPartsTwelve.add(getVectorOnCircle(constructionCircleCenters.get(10), 300)); + // 330° + constructionPartsTwelve.add(getVectorOnCircle(constructionCircleCenters.get(10), 0)); + } + + void createDividingConstructionLines(int amount){ + stroke(0.66, 0.66, 0.66, 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)); + } + + void createDividingLines(int amount){ + stroke(0.0, 0.66, 0.0, 0.4); + createLine(constructionCircleCenters.get(0), constructionCircleCenters.get(6)); + createLine(constructionCircleCenters.get(1), constructionCircleCenters.get(7)); + createLine(constructionCircleCenters.get(2), constructionCircleCenters.get(8)); + createLine(constructionCircleCenters.get(3), constructionCircleCenters.get(9)); + createLine(constructionCircleCenters.get(4), constructionCircleCenters.get(10)); + createLine(constructionCircleCenters.get(5), constructionCircleCenters.get(11)); + } + + void createConstructionCircles(){ + stroke(0.66, 0.66, 0.66, 0.4); + createCircle(constructionCircleCenters.get(0)); + createCircle(constructionCircleCenters.get(2)); + createCircle(constructionCircleCenters.get(4)); + createCircle(constructionCircleCenters.get(6)); + createCircle(constructionCircleCenters.get(8)); + createCircle(constructionCircleCenters.get(10)); + } + + void createInnerHexagon(){ + stroke(0.0, 0.0, 0.66, 0.4); + beginShape(LINES); + vertex(constructionCircleCenters.get(1).x, constructionCircleCenters.get(1).y); + vertex(constructionCircleCenters.get(3).x, constructionCircleCenters.get(3).y); + vertex(constructionCircleCenters.get(3).x, constructionCircleCenters.get(3).y); + vertex(constructionCircleCenters.get(5).x, constructionCircleCenters.get(5).y); + vertex(constructionCircleCenters.get(5).x, constructionCircleCenters.get(5).y); + vertex(constructionCircleCenters.get(7).x, constructionCircleCenters.get(7).y); + vertex(constructionCircleCenters.get(7).x, constructionCircleCenters.get(7).y); + vertex(constructionCircleCenters.get(9).x, constructionCircleCenters.get(9).y); + vertex(constructionCircleCenters.get(9).x, constructionCircleCenters.get(9).y); + vertex(constructionCircleCenters.get(11).x, constructionCircleCenters.get(11).y); + vertex(constructionCircleCenters.get(11).x, constructionCircleCenters.get(11).y); + vertex(constructionCircleCenters.get(1).x, constructionCircleCenters.get(1).y); + endShape(); + } + + void display() { + super.display(); + createDividingLines(12); + createInnerHexagon(); + } + + void displayConstructionLines(){ + super.displayConstructionLines(); + createDividingConstructionLines(12); + } +} -- cgit v1.2.3-54-g00ecf