-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmath_art_clock.scad
174 lines (125 loc) · 3.18 KB
/
math_art_clock.scad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
// MathArt Clock
// Inspired by Structure Clock http://www.thingiverse.com/thing:557190
// CC BY-SA 3.0 Tom Øyvind Hogstad 2014-15
// Sources:
// Peano-Gosper Curve http://hiiragicompany.net/ls.html
// Hilbert Curve http://upload.wikimedia.org/wikipedia/en/a/a5/Hilbert_curve.svg
// Escher Lizard http://www.inkscapeforum.com/viewtopic.php?f=5&t=2856
use <utility.scad>
// Comment / uncomment selected curve or tesselation
//use <hilbert.scad>
//use <escher_lizard.scad>
//use <gosper.scad>
use <voronoi.scad>
//Size of Clock
r1 = 80;
r2 = 85;
layer = 0.3; // Layerheight
solid_layers = 3;
nozzle = 0.4;
// Perimeters - slic3r tend to change this around between versions
e_perimeters_ew = 0.4; // External perimeters
//perimeter_ew = 0.67; // lh=0.2
perimeters_ew = 0.4; // lh=0.3
/*
Going for "3" perimeters width.
*/
wall = 3*e_perimeters_ew;
rim = wall*4; // Edge of clock
mech = [56,56,17]; // Size of mechanism
mech_padded = mech + [2,2,1];
mech_box = mech_padded + [2*wall,2*wall, layer*3];
center_r = 5; // Clock pin
center_h = 6; // Height of face in front of mechanism
h = mech_padded[2]+center_h;
dr = r2-r1;
// Calculations for stand
c = hypotenuse(h,dr);
_t = asin(dr/c);
_a = 90-_t;
s = sin(_t) * r1;
sr = 60;
sl = hypotenuse(sr,sr);
ss = sagitta(r1,sl/2);
fl = round(hypotenuse(ss,ss));
clock();
//stand();
//stand_one_piece();
module stand_one_piece() {
echo(sr+fl);
k = sqrt(sqr((sr+fl))/2);
echo(k);
translate([0,-k,0]) rotateX(-45) stand_body();
rotate(180) mirror() translate([0,-k,0]) rotateX(-45) stand_body();
translateZ(k-hypotenuse(20,20)/2-hypotenuse(4*wall,4*wall)+0.1)
translateX(c+s+4)
rotateY(-90)
translateY(-hypotenuse(20,20)/2)
rotateZ(45)
difference() {
cube([20,20,5]);
rotateZ(45) cube([30,30,5]);
}
}
module clock() {
body();
}
module body(print=false) {
difference() {
union() {
difference() {
cylinder(r1=poly(r1, 240), r2=poly(r2,240), h=h, $fn=240);
translateZ(-1) cylinder(r1=poly(r1-rim, 240), r2=poly(r2-rim,240), h=h+2, $fn=240);
}
intersection() {
translateZ(-1) cylinder(r1=poly(r1-1, 240), r2=poly(r2-1,240), h=h+2, $fn=240);
scale([wall,wall,1]) curve(h);
}
cube_centered(mech_box);
cylinder(r=poly(center_r+wall,32), h=h, $fn=32);
}
body_holes(print);
}
}
module body_holes(print=false) {
translateZ(-layer) cube_centered(mech_padded);
#translateZ(mech_padded[2]) cylinder(r=poly(center_r,32), h=h, $fn=32);
}
// Optional stand, glue together
module stand() {
translateX(-20) mirror()
rotateX(90)
stand_body();
rotateX(90)
stand_body();
translateY(10)
difference() {
cube([20,20,5]);
rotateZ(45) cube([30,30,5]);
}
}
module stand_cut() {
difference() {
rotateY(_t) cube([c,4*wall,sr+fl]);
translateZ(-10) cube([c*2,4*wall,10]);
}
}
module stand_body() {
difference() {
cube([c+s+5, 4*wall, sr+fl]);
translate([0,0,fl+5]) cube([c,4*wall,sr+fl]);
translate([2*wall,0,fl]) stand_cut();
rotateX(-45) cube([c+s+5, 10, 10]);
translateZ(sr+fl) rotateX(-45) cube([c+s+5, 10, 10]);
translate([-c-1,0,fl-1]) stand_cut();
}
}
echo("wall: ", wall);
echo("dr: ", dr);
echo("c: ", c);
echo("_t: ", _t);
echo("_a: ", _a);
echo("s: ", s);
echo("sl: ", sl);
echo("ss: ", ss);
echo("fl: ", fl);