From d8aa68606dd8596309d3f3c1a69c3c84b0471bf5 Mon Sep 17 00:00:00 2001 From: David Runge Date: Sat, 2 Jan 2016 06:30:21 +0100 Subject: AutoVisual/IGPSquare.pde: Switching to extendLine() when calculating PVectors for 12 and 16 parts setups on outer square. --- AutoVisual/IGPSquare.pde | 57 ++++++++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/AutoVisual/IGPSquare.pde b/AutoVisual/IGPSquare.pde index 3c3e2a3..b23176f 100644 --- a/AutoVisual/IGPSquare.pde +++ b/AutoVisual/IGPSquare.pde @@ -20,35 +20,36 @@ class IGPSquare extends IGPFamily { 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)); + constructionPartsTwelve.add(alphaCircleVectors.get(0)); + constructionPartsTwelve.add(extendLine(mid, alphaCircleVectors.get(1), mid.x+radius, false)); + constructionPartsTwelve.add(extendLine(mid, alphaCircleVectors.get(2), mid.y-radius, true)); + constructionPartsTwelve.add(alphaCircleVectors.get(3)); + constructionPartsTwelve.add(extendLine(mid, alphaCircleVectors.get(4), mid.y-radius, true)); + constructionPartsTwelve.add(extendLine(mid, alphaCircleVectors.get(5), mid.x-radius, false)); + constructionPartsTwelve.add(alphaCircleVectors.get(6)); + constructionPartsTwelve.add(extendLine(mid, alphaCircleVectors.get(7), mid.x-radius, false)); + constructionPartsTwelve.add(extendLine(mid, alphaCircleVectors.get(8), mid.y+radius, true)); + constructionPartsTwelve.add(alphaCircleVectors.get(9)); + constructionPartsTwelve.add(extendLine(mid, alphaCircleVectors.get(10), mid.y+radius, true)); + constructionPartsTwelve.add(extendLine(mid, alphaCircleVectors.get(11), mid.x+radius, false)); + 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)); + constructionPartsSixteen.add(alphaCircleVectorsSixteen.get(0)); + constructionPartsSixteen.add(extendLine(mid, alphaCircleVectorsSixteen.get(1), mid.x+radius, false)); + constructionPartsSixteen.add(new PVector(mid.x+radius, mid.y-radius)); + constructionPartsSixteen.add(extendLine(mid, alphaCircleVectorsSixteen.get(3), mid.y-radius, true)); + constructionPartsSixteen.add(alphaCircleVectorsSixteen.get(4)); + constructionPartsSixteen.add(extendLine(mid, alphaCircleVectorsSixteen.get(5), mid.y-radius, true)); + constructionPartsSixteen.add(new PVector(mid.x-radius, mid.y-radius)); + constructionPartsSixteen.add(extendLine(mid, alphaCircleVectorsSixteen.get(7), mid.x-radius, false)); + constructionPartsSixteen.add(alphaCircleVectorsSixteen.get(8)); + constructionPartsSixteen.add(extendLine(mid, alphaCircleVectorsSixteen.get(9), mid.x-radius, false)); + constructionPartsSixteen.add(new PVector(mid.x-radius, mid.y+radius)); + constructionPartsSixteen.add(extendLine(mid, alphaCircleVectorsSixteen.get(11), mid.y+radius, true)); + constructionPartsSixteen.add(alphaCircleVectorsSixteen.get(12)); + constructionPartsSixteen.add(extendLine(mid, alphaCircleVectorsSixteen.get(13), mid.y+radius, true)); + constructionPartsSixteen.add(new PVector(mid.x+radius, mid.y+radius)); + constructionPartsSixteen.add(extendLine(mid, alphaCircleVectorsSixteen.get(15), mid.x+radius, false)); } void createDividingLines(){ -- cgit v1.2.3-70-g09d2