[Simple problem] Irregular thickness of lines
in
Programming Questions
•
1 year ago
I can't seem to get the thickness of these lines consistent
int endLegsVERT = 650;
int yThick = 50; // Vertical location of each line
int xThick = 50; // Initial horizontal location for first line
int spacingVThick = 200; // How far apart is each line
int len = 600; // Length of each line
int yThin = 50; // Vertical location of each line
int xThin = 50; // Initial horizontal location for first line
int spacingVThin = 67; // How far apart is each line
//horizontal - thick
int endHori = 650;
int xHori = 50;
int yHori = 50;
int hSpacing = 200;
//Horizontal thin
int xHoriThin = 50;
int yHoriThin = 50;
int hThinSpacing = 67;
void setup() {
size (700, 700);
background(255);
rectMode (CENTER);
rect(350, 350, 600, 600);
strokeWeight(3); // Thin Gray lines
stroke(0);
while (yHoriThin <= endHori) {
line (xHoriThin, yHoriThin, xHoriThin + 600, yHoriThin);
yHoriThin = yHoriThin + hThinSpacing;
}
stroke(0);
strokeWeight(3);
while (yHori <= endHori) {
line (xHori, yHori, xHori + 600, yHori);
yHori = yHori + hSpacing;
}
strokeWeight (3);
while (xThick <= endLegsVERT) {
line (xThick, yThick, xThick, yThick + len);
xThick = xThick + spacingVThick;
}
strokeWeight(3);
while (xThin <= endLegsVERT) {
line (xThin, yThin, xThin, yThin + len);
xThin = xThin + spacingVThin;
}
}
1