From 4c8c61a6241e4b1f92a35e92004d550474895644 Mon Sep 17 00:00:00 2001 From: David Runge Date: Fri, 1 Jan 2016 17:29:07 +0100 Subject: AutoVisual/IGP{Family,Square}.pde: Simplifying createDiagonalConstructionLines{OnOuterSquare,OnAlphaCircle}(). Adding createDiagonalconstructionLinesOnOuterSquare() to IGPSquare class. --- AutoVisual/IGPFamily.pde | 13 +++++++++---- AutoVisual/IGPSquare.pde | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/AutoVisual/IGPFamily.pde b/AutoVisual/IGPFamily.pde index 2dc2398..3108686 100644 --- a/AutoVisual/IGPFamily.pde +++ b/AutoVisual/IGPFamily.pde @@ -97,10 +97,15 @@ class IGPFamily { createLine(alphaCircleVectors.get(3), alphaCircleVectors.get(9)); } - void createDiagonalConstructionLines(){ - //TODO: add for 16 parts - createLine(new PVector(constructionCircleCenters.get(1).x-radius, constructionCircleCenters.get(2).y-radius), new PVector(constructionCircleCenters.get(3).x+radius, constructionCircleCenters.get(0).y+radius)); - createLine(new PVector(constructionCircleCenters.get(1).x+radius, constructionCircleCenters.get(0).y-radius), new PVector(constructionCircleCenters.get(3).x-radius, constructionCircleCenters.get(2).y+radius)); + void createDiagonalConstructionLinesOnOuterSquare(){ + createLine(new PVector(mid.x+radius, mid.y+radius), new PVector(mid.x-radius, mid.y-radius)); + createLine(new PVector(mid.x+radius, mid.y-radius), new PVector(mid.x-radius, mid.y+radius)); + } + + void createDiagonalConstructionLinesOnAlphaCircle(){ + //TODO: use PVectors from ArrayList + createLine(getVectorOnAlphaCircle(45), getVectorOnAlphaCircle(225)); + createLine(getVectorOnAlphaCircle(135), getVectorOnAlphaCircle(315)); } void createInnerHexagon(){ diff --git a/AutoVisual/IGPSquare.pde b/AutoVisual/IGPSquare.pde index b1e8669..3c3e2a3 100644 --- a/AutoVisual/IGPSquare.pde +++ b/AutoVisual/IGPSquare.pde @@ -100,7 +100,7 @@ class IGPSquare extends IGPFamily { void displayConstructionLines(){ super.displayConstructionLines(); - createDiagonalConstructionLines(); + createDiagonalConstructionLinesOnOuterSquare(); if (parts == 16){ createInnerSquare(); createInnerSquareTilted(45); -- cgit v1.2.3-70-g09d2