Skip to content

Commit 3e78008

Browse files
committed
add empty closed puzzle
1 parent 1d85142 commit 3e78008

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
p_x = 19; // side length of puzzle piece
2+
p_y = 19; // side length of puzzle piece
3+
p_z = 2; // height of puzzle piece
4+
d = 0.3; // distance between puzzle pieces
5+
h_s = 0.35; // knob size
6+
h_d = 0.13; // knob distance
7+
amount = [10, 10]; // how many pieces one wants
8+
$fn = 50;
9+
10+
module smalldot()
11+
resize([p_x * h_s -d, p_y * h_s - d]) cylinder(p_z, 10, 10);
12+
13+
module bigdot()
14+
resize([p_x * h_s +d, p_y * h_s +d]) cylinder(p_z*3, 10, 10, true);
15+
16+
module puzzle()
17+
for (x= [0 : amount[0]-1], y = [0 : amount[1]-1]) translate([x * p_x, y * p_y]) {
18+
difference(){
19+
union(){
20+
cube([p_x -d, p_y -d, p_z]);
21+
// The following enumeration can be used
22+
// when the pieces shall get shuffeled later
23+
//color("blue") linear_extrude(p_z * 3) text(str(x*10 + y));
24+
};
25+
if(x>-1 && y>0) translate([p_x * 0.5, p_y * h_d]) bigdot();
26+
if(x>0 && y>-1) translate([p_x * h_d, p_y * 0.5]) bigdot();
27+
};
28+
if(x<amount[0]-1) translate([p_x * (h_d + 1), p_y * 0.5]) smalldot();
29+
if(y<amount[1]-1) translate([p_x * 0.5, p_y * (h_d + 1)]) smalldot();
30+
}
31+
32+
puzzle();

0 commit comments

Comments
 (0)