]> www.fi.muni.cz Git - things.git/blob - pencil_stand.scad
pencil box/stand
[things.git] / pencil_stand.scad
1 eps = 0.01;
2 infty = 200;
3
4 thin_wall = 0.5;
5 wall = 1.5;
6
7 body_d = 60;
8 body_h = 80;
9
10
11 front_hex_r = body_d/8;
12 rear_hex_r = body_d/5;
13 rear_hex_xoff = -5;
14
15 module hex_wall() {
16
17 difference() {
18         cube([body_h, body_d, 2]);
19         for (y = [0:12])
20         for (x = [0:7]) {
21                 translate([(2+2*sin(30))*y*front_hex_r, front_hex_r*sin(60)*(1+2*x), -eps])
22                         cylinder(r1 = front_hex_r-2, r2 = front_hex_r, 2+2*eps, $fn = 6);
23                 translate([(2+2*sin(30))*y*front_hex_r+(1+sin(30))*front_hex_r, front_hex_r*sin(60)*(2*x), -eps])
24                         cylinder(r1 = front_hex_r-2, r2 = front_hex_r, 2+2*eps, $fn = 6);
25         }
26 }
27
28 scale([1, 1, -1])
29 difference() {
30         cube([80, 60, 2]);
31         translate([rear_hex_xoff, 0, 0])
32         for (y = [0:12])
33         for (x = [0:7]) {
34                 translate([(2+2*sin(30))*y*rear_hex_r, rear_hex_r*sin(60)*(1+2*x), -eps])
35                         cylinder(r1 = rear_hex_r-2, r2 = rear_hex_r, 2+2*eps, $fn = 6);
36                 translate([(2+2*sin(30))*y*rear_hex_r+(1+sin(30))*rear_hex_r, rear_hex_r*sin(60)*(2*x), -eps])
37                         cylinder(r1 = rear_hex_r-2, r2 = rear_hex_r, 2+2*eps, $fn = 6);
38         }
39 }
40 }
41
42
43 rotate([0, -90, 0]) hex_wall();
44 translate([body_d, body_d, 0]) scale([-1, -1, 1]) rotate([0, -90, 0]) hex_wall();
45 rotate([0, -90, -90]) scale([1, 1, -1]) hex_wall();
46 translate([body_d, body_d, 0]) rotate([0, -90, -90]) scale([1, -1, 1]) hex_wall();
47
48 cube([body_d, body_d, 2]);
49
50 module corner() {
51         translate([-2, -2, 0]) cube([4, 4, body_h]);
52 }
53
54 corner();
55 translate([body_d, 0, 0]) corner();
56 translate([0, body_d, 0]) corner();
57 translate([body_d, body_d, 0]) corner();
58
59 module upper() {
60         intersection() {
61                 rotate([0, 90, 0])
62                         cylinder(r = 2, h = body_d, $fn = 4);
63                 translate([-eps, -2, -2-eps]) cube([body_d, 4, 2+eps]);
64         }
65 }
66 translate([0, 0, body_h]) upper();
67 translate([0, body_d, body_h]) upper();
68 translate([0, body_d, body_h]) rotate([0, 0, -90]) upper();
69 translate([body_d, body_d, body_h]) rotate([0, 0, -90]) upper();
70
71 scale([1, 1, -1]) {
72 translate([0, 0, 0]) upper();
73 translate([0, body_d, 0]) upper();
74 translate([0, body_d, 0]) rotate([0, 0, -90]) upper();
75 translate([body_d, body_d, 0]) rotate([0, 0, -90]) upper();
76 }
77
78 module mid_wall() {
79         translate([-thin_wall/2, 0, 0]) cube([thin_wall, body_d, body_h]);
80 }
81
82 mid_wall();
83 rotate([0, 0, -90]) mid_wall();
84 translate([body_d, 0, 0]) mid_wall();
85 translate([0, body_d, 0]) rotate([0, 0, -90]) mid_wall();
86