diff --git a/README.md b/README.md index d3b1368..ab7af47 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Other variables: ```java public int canvasWidth = 800; public int canvasHeight = 600; -public float canvasScalar = 1.25; +public float canvasScalar = 1.0; public boolean display = true; public int windowWidth = 800; @@ -60,6 +60,7 @@ public boolean gammaCorrection = false; public float gamma = 1.0; public boolean fill = false; +public boolean dot = false; public float line = 1.0; ``` diff --git a/stipple_gen.pde b/stipple_gen.pde index 5727aa0..c744688 100644 --- a/stipple_gen.pde +++ b/stipple_gen.pde @@ -111,6 +111,8 @@ public class Config { public float gamma = 1.0; public boolean fill = false; + public float fillAngle = 45.0; + public boolean fillRandom = false; public boolean dot = false; public float line = 1.0; @@ -285,6 +287,12 @@ public class Config { case "fill" : fill = boolOrDie(name, val); break; + case "fillAngle" : + fillAngle = floatOrDie(name, val); + break; + case "fillRandom" : + fillRandom = boolOrDie(name, val); + break; case "dot" : dot = boolOrDie(name, val); break; @@ -1188,6 +1196,7 @@ void draw () { float dotRad; float dotDiam; float cutoffScaled = 1 - config.cutoff; + float hatchAngle; ArrayList hatchLines; canvas.beginDraw(); @@ -1329,7 +1338,8 @@ void draw () { } canvas.ellipse(px, py, dotDiam, dotDiam); if (!config.dot && config.fill) { - hatchLines = fillCircle(px, py, dotDiam, 45.0, config.line * config.canvasScalar); + hatchAngle = config.fillRandom ? random(0.0, 360.0) : config.fillAngle; + hatchLines = fillCircle(px, py, dotDiam, hatchAngle, config.line * config.canvasScalar); if (hatchLines.size() > 0) { for (float[] linePoints : hatchLines) { canvas.line(linePoints[0], linePoints[1], linePoints[2], linePoints[3]); @@ -1458,7 +1468,8 @@ void draw () { } if (!config.dot && config.fill) { - hatchLines = fillCircle(xTemp, yTemp, dotRad * 2.0, 45.0, config.line); + hatchAngle = config.fillRandom ? random(0.0, 360.0) : config.fillAngle; + hatchLines = fillCircle(xTemp, yTemp, dotRad * 2.0, hatchAngle, config.line); if (hatchLines.size() > 0) { for (float[] linePoints : hatchLines) { rowTemp += "";