Skip to content

Commit

Permalink
Fix off by one error generating letters
Browse files Browse the repository at this point in the history
  • Loading branch information
rtitmuss committed Dec 30, 2022
1 parent 63d7c43 commit 7f01e18
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions OpenSCAD/flaps.scad
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ if (SINGLE_FLAP) {
// A grid if flaps
module FlapGrid(printJob, layer) {
offset = printJob * FLAPS;
letters = substring(LETTERS, offset, min([offset + FLAPS, len(LETTERS)]));
letters = substring(LETTERS, offset, min([offset + FLAPS + 1, len(LETTERS)]));

echo(letters)

for (i = [0 : len(letters)-1]) {
for (i = [0 : min([FLAPS - 1, len(letters) - 2])]) {
row = i % ROWS;
col = floor(i / ROWS);

Expand Down

0 comments on commit 7f01e18

Please sign in to comment.