Skip to content

Commit

Permalink
Quadrille.TILE improved; v1.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
nakednous committed Aug 28, 2023
1 parent fe74ebb commit d7d08d9
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 103 deletions.
42 changes: 2 additions & 40 deletions p5.quadrille.js
Original file line number Diff line number Diff line change
Expand Up @@ -1147,58 +1147,20 @@ class Quadrille {
outlineWeight = this.OUTLINE_WEIGHT
} = {}) {
if (outlineWeight !== 0) {
// modes _ _ _ _
// 0 (last row & col): |_| 1 (inner cells): | 2 (last row): |_ 3 (last col): | |
const mode = row === height - 1 && col === width - 1 ? 0 :
row < height - 1 && col < width - 1 ? 1 : row === height - 1 && col < width - 1 ? 2 : 3;
graphics.noFill();
graphics.stroke(outline);
graphics.strokeWeight(outlineWeight);
// /*
graphics.beginShape();
if (mode === 2) graphics.vertex(cellLength, cellLength);
graphics.vertex(0, cellLength);
graphics.vertex(0, 0);
graphics.vertex(cellLength, 0);
if (mode === 0 || mode === 3) graphics.vertex(cellLength, cellLength);
mode === 0 ? graphics.endShape(CLOSE) : graphics.endShape();
// */
/*
switch (mode) {
case 1: // frequent case
graphics.stroke('red'); // debug
graphics.beginShape();
graphics.vertex(0, cellLength);
graphics.vertex(0, 0);
graphics.vertex(cellLength, 0);
graphics.endShape();
break;
case 2: // last row
graphics.stroke('green'); // debug
graphics.beginShape();
graphics.vertex(cellLength, cellLength);
graphics.vertex(0, cellLength);
graphics.vertex(0, 0);
graphics.vertex(cellLength, 0);
graphics.endShape();
break;
case 3: // last col
graphics.stroke('blue'); // debug
graphics.beginShape();
graphics.vertex(0, cellLength);
graphics.vertex(0, 0);
graphics.vertex(cellLength, 0);
graphics.vertex(cellLength, cellLength);
graphics.endShape();
break;
default: // all edges (last row & last col)
graphics.stroke('magenta'); // debug
graphics.beginShape();
graphics.vertex(0, cellLength);
graphics.vertex(0, 0);
graphics.vertex(cellLength, 0);
graphics.vertex(cellLength, cellLength);
graphics.endShape(CLOSE);
}
// */
}
}
}
Expand Down
19 changes: 0 additions & 19 deletions tile/index.html

This file was deleted.

36 changes: 0 additions & 36 deletions tile/sketch.js

This file was deleted.

8 changes: 0 additions & 8 deletions tile/style.css

This file was deleted.

0 comments on commit d7d08d9

Please sign in to comment.