1
0
mirror of https://github.com/JustinSDK/dotSCAD.git synced 2025-08-12 09:44:16 +02:00
This commit is contained in:
Justin Lin
2022-04-01 13:44:49 +08:00
parent 197c542c5e
commit 98f9d8ea57

View File

@@ -70,8 +70,7 @@ module multiplication_puzzle(n, piece_side_length, spacing, same_height = false,
n_minus_one = n - 1; n_minus_one = n - 1;
intersection() { intersection() {
union() for(x = [0 : n_minus_one]) { union() for(x = [0 : n_minus_one], y = [0 : n_minus_one]) {
for(y = [0 : n_minus_one]) {
pos = [piece_side_length * x, piece_side_length * y]; pos = [piece_side_length * x, piece_side_length * y];
r = (x + 1) * (y + 1); r = (x + 1) * (y + 1);
linear_extrude(same_height ? height : r) union() { linear_extrude(same_height ? height : r) union() {
@@ -100,7 +99,6 @@ module multiplication_puzzle(n, piece_side_length, spacing, same_height = false,
translate(pos) translate(pos)
puzzle_piece(piece_side_length, spacing); puzzle_piece(piece_side_length, spacing);
} }
}
linear_extrude(same_height ? height : n * n) linear_extrude(same_height ? height : n * n)
square(piece_side_length * n - spacing * 1.5); square(piece_side_length * n - spacing * 1.5);