From f7b4d417153ca5d670d17a1c061654a42df4af25 Mon Sep 17 00:00:00 2001 From: mattmcw Date: Wed, 8 Dec 2021 22:58:31 -0500 Subject: [PATCH] Improvement in fillCircle: by reducing the number of fill lines in half, the hatching showed visible gaps between lines. This new method ensures a fuller circle. Tested and renders more closely match plotted drawings. --- stipple_gen.pde | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stipple_gen.pde b/stipple_gen.pde index 6a9df6a..85c2f69 100644 --- a/stipple_gen.pde +++ b/stipple_gen.pde @@ -1145,9 +1145,9 @@ ArrayList fillCircle (float x, float y, float d, float angle, float lin float testY = 0; float[] intersect; - for (int i = -floor(lines / 2); i < floor(lines / 2); i++) { - perpX = x + ((line * (i + 0.5)) * cos(perpRadian)); - perpY = y + ((line * (i + 0.5)) * sin(perpRadian)); + for (int i = -lines; i < lines; i++) { + perpX = x + ( ( (line / 2) * (i + 0.5) ) * cos(perpRadian)); + perpY = y + ( ( (line / 2) * (i + 0.5) ) * sin(perpRadian)); testX = perpX + (d * cos(radian)); testY = perpY + (d * sin(radian)); @@ -1173,7 +1173,7 @@ ArrayList fillCircle (float x, float y, float d, float angle, float lin } if (dist(startX, startY, endX, endY) > line) { - float[] linePoints = {startX, startY, endX, endY}; + float[] linePoints = { startX, startY, endX, endY }; output.add(linePoints); } }