Normalize all variables to camelcase. Formerly MinDotSize, MaxDotSize and DotSizeFactor.

This commit is contained in:
mattmcw 2021-03-24 10:21:50 -04:00
parent 629b4e86d4
commit 83e3ecff12
1 changed files with 22 additions and 22 deletions

View File

@ -105,9 +105,9 @@ public class Config {
public int testsPerFrame = 90000; // public int testsPerFrame = 90000; //
public int maxGenerations = 5; //number of generations public int maxGenerations = 5; //number of generations
public float MinDotSize = 1.25; //2; public float minDotSize = 1.25; //2;
public float MaxDotSize; public float maxDotSize;
public float DotSizeFactor = 4; //5; public float dotSizeFactor = 4; //5;
public int maxParticles = 2000; // Max value is normally 10000. public int maxParticles = 2000; // Max value is normally 10000.
public float cutoff = 0; // White cutoff value public float cutoff = 0; // White cutoff value
@ -260,14 +260,14 @@ public class Config {
case "maxGenerations" : case "maxGenerations" :
maxGenerations = intOrDie(name, val); maxGenerations = intOrDie(name, val);
break; break;
case "MinDotSize" : case "minDotSize" :
MinDotSize = floatOrDie(name, val); minDotSize = floatOrDie(name, val);
break; break;
case "MaxDotSize" : case "maxDotSize" :
MaxDotSize = floatOrDie(name, val); maxDotSize = floatOrDie(name, val);
break; break;
case "DotSizeFactor" : case "dotSizeFactor" :
DotSizeFactor = floatOrDie(name, val); dotSizeFactor = floatOrDie(name, val);
break; break;
case "maxParticles" : case "maxParticles" :
maxParticles = intOrDie(name, val); maxParticles = intOrDie(name, val);
@ -500,7 +500,7 @@ void setup () {
MainArraysetup(); // Main particle array setup MainArraysetup(); // Main particle array setup
config.MaxDotSize = config.MinDotSize * (1 + config.DotSizeFactor); //best way to do this? config.maxDotSize = config.minDotSize * (1 + config.dotSizeFactor); //best way to do this?
ReInitiallizeArray = false; ReInitiallizeArray = false;
showBG = false; showBG = false;
@ -656,18 +656,18 @@ void Stipples(int inValue) {
} }
void Min_Dot_Size(float inValue) { void Min_Dot_Size(float inValue) {
if (config.MinDotSize != inValue) { if (config.minDotSize != inValue) {
println("Update: Min_Dot_Size -> " + inValue); println("Update: Min_Dot_Size -> " + inValue);
config.MinDotSize = inValue; config.minDotSize = inValue;
config.MaxDotSize = config.MinDotSize* (1 + config.DotSizeFactor); config.maxDotSize = config.minDotSize* (1 + config.dotSizeFactor);
} }
} }
void Dot_Size_Range(float inValue) { void Dot_Size_Range(float inValue) {
if (config.DotSizeFactor != inValue) { if (config.dotSizeFactor != inValue) {
println("Update: Dot Size Range -> " + inValue); println("Update: Dot Size Range -> " + inValue);
config.DotSizeFactor = inValue; config.dotSizeFactor = inValue;
config.MaxDotSize = config.MinDotSize* (1 + config.DotSizeFactor); config.maxDotSize = config.minDotSize* (1 + config.dotSizeFactor);
} }
} }
@ -1162,7 +1162,7 @@ void draw () {
int i = 0; int i = 0;
int temp; int temp;
int scaledDimension; int scaledDimension;
float dotScale = (config.MaxDotSize - config.MinDotSize); float dotScale = (config.maxDotSize - config.minDotSize);
float cutoffScaled = 1 - config.cutoff; float cutoffScaled = 1 - config.cutoff;
canvas.beginDraw(); canvas.beginDraw();
@ -1225,7 +1225,7 @@ void draw () {
if (showCells) { if (showCells) {
// Show "before and after" centroids, when polygons are shown. // Show "before and after" centroids, when polygons are shown.
// Normal w/ Min & Max dot size // Normal w/ Min & Max dot size
strokeWeight(config.MinDotSize); strokeWeight(config.minDotSize);
for ( i = 0; i < config.maxParticles; ++i) { for ( i = 0; i < config.maxParticles; ++i) {
int px = (int) particles[i].x; int px = (int) particles[i].x;
@ -1238,7 +1238,7 @@ void draw () {
//float v = (brightness(imgblur.pixels[ py*imgblur.width + px ]))/255; //float v = (brightness(imgblur.pixels[ py*imgblur.width + px ]))/255;
//if (config.invert) //if (config.invert)
//v = 1 - v; //v = 1 - v;
//strokeWeight (config.MaxDotSize - v * dotScale); //strokeWeight (config.maxDotSize - v * dotScale);
canvas.point(px, py); canvas.point(px, py);
} }
} }
@ -1271,7 +1271,7 @@ void draw () {
} }
if (v < cutoffScaled) { if (v < cutoffScaled) {
canvas.strokeWeight(config.MaxDotSize - v * dotScale); canvas.strokeWeight(config.maxDotSize - v * dotScale);
canvas.point(px, py); canvas.point(px, py);
} }
} }
@ -1370,7 +1370,7 @@ void draw () {
v = 1 - v; v = 1 - v;
} }
float dotrad = (config.MaxDotSize - v * dotScale) / 2; float dotrad = (config.maxDotSize - v * dotScale) / 2;
float xTemp = SVGscale*p1.x + xOffset; float xTemp = SVGscale*p1.x + xOffset;
float yTemp = SVGscale*p1.y + yOffset; float yTemp = SVGscale*p1.y + yOffset;
@ -1379,7 +1379,7 @@ void draw () {
"\" style=\"fill:none;stroke:black;stroke-width:1;\"/>"; "\" style=\"fill:none;stroke:black;stroke-width:1;\"/>";
// Typ: <circle cx="1600" cy="450" r="3" style="fill:none;stroke:black;stroke-width:2;"/> // Typ: <circle cx="1600" cy="450" r="3" style="fill:none;stroke:black;stroke-width:2;"/>
if (config.fill) { if (config.fill) {
hatchLines = fillCircle(xTemp, yTemp, dotrad, 45.0, config.MaxDotSize); hatchLines = fillCircle(xTemp, yTemp, dotrad, 45.0, config.maxDotSize);
if (hatchLines.size() > 0) { if (hatchLines.size() > 0) {
for (float[] linePoints : hatchLines) { for (float[] linePoints : hatchLines) {
rowTemp += "<line x1=\"" + linePoints[0] + "\" y1=\"" + linePoints[1] + "\" x2=\"" + linePoints[2] + "\" y2=\"" + linePoints[3] + "\" style=\"fill:none;stroke:black;stroke-width:1;\"/>"; rowTemp += "<line x1=\"" + linePoints[0] + "\" y1=\"" + linePoints[1] + "\" x2=\"" + linePoints[2] + "\" y2=\"" + linePoints[3] + "\" style=\"fill:none;stroke:black;stroke-width:1;\"/>";