]> www.fi.muni.cz Git - things.git/blob - pencil_stand.scad
switch holder.scad
[things.git] / pencil_stand.scad
1 eps = 0.01;
2 infty = 200;
3
4 thin_wall = 0.6;
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 /*/
29 scale([1, 1, -1])
30 difference() {
31         cube([80, 60, 2]);
32         translate([rear_hex_xoff, 0, 0])
33         for (y = [0:12])
34         for (x = [0:7]) {
35                 translate([(2+2*sin(30))*y*rear_hex_r, rear_hex_r*sin(60)*(1+2*x), -eps])
36                         cylinder(r1 = rear_hex_r-2, r2 = rear_hex_r, 2+2*eps, $fn = 6);
37                 translate([(2+2*sin(30))*y*rear_hex_r+(1+sin(30))*rear_hex_r, rear_hex_r*sin(60)*(2*x), -eps])
38                         cylinder(r1 = rear_hex_r-2, r2 = rear_hex_r, 2+2*eps, $fn = 6);
39         }
40 }
41 */
42 }
43
44
45 rotate([0, -90, 0]) hex_wall();
46 translate([body_d, body_d, 0]) scale([-1, -1, 1]) rotate([0, -90, 0]) hex_wall();
47 rotate([0, -90, -90]) scale([1, 1, -1]) hex_wall();
48 translate([body_d, body_d, 0]) rotate([0, -90, -90]) scale([1, -1, 1]) hex_wall();
49
50 cube([body_d, body_d, 2]);
51
52 module corner() {
53         translate([-2, -2, 0]) cube([4, 4, body_h]);
54 }
55
56 corner();
57 translate([body_d, 0, 0]) corner();
58 translate([0, body_d, 0]) corner();
59 translate([body_d, body_d, 0]) corner();
60
61 module upper() {
62         intersection() {
63                 rotate([0, 90, 0])
64                         cylinder(r = 2, h = body_d, $fn = 4);
65                 translate([-eps, -2, -2-eps]) cube([body_d, 4, 2+eps]);
66         }
67 }
68 translate([0, 0, body_h]) upper();
69 translate([0, body_d, body_h]) upper();
70 translate([0, body_d, body_h]) rotate([0, 0, -90]) upper();
71 translate([body_d, body_d, body_h]) rotate([0, 0, -90]) upper();
72
73 scale([1, 1, -1]) {
74 translate([0, 0, 0]) upper();
75 translate([0, body_d, 0]) upper();
76 translate([0, body_d, 0]) rotate([0, 0, -90]) upper();
77 translate([body_d, body_d, 0]) rotate([0, 0, -90]) upper();
78 }
79
80 module mid_wall() {
81         translate([-thin_wall/2, 0, 0]) cube([thin_wall, body_d, body_h]);
82 }
83
84 mid_wall();
85 rotate([0, 0, -90]) mid_wall();
86 translate([body_d, 0, 0]) mid_wall();
87 translate([0, body_d, 0]) rotate([0, 0, -90]) mid_wall();
88