-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathfluted_column.scad
164 lines (143 loc) · 4.3 KB
/
fluted_column.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
$fa = 0.01; $fs =2;
pi = 3.14159265359;
max=200;
function v_sum_r(v,n,k) =
k > n ? 0 : v[k] + v_sum_r(v,n,k+1);
function v_sum(v,n) = v_sum_r(v,n-1,0);
module facade () {
difference() {
rotate([0,90,0]) child(0);
translate([max-1,0,-max]) cube (2*max,center=true);
}
}
module bottom(x) {
difference() {
child(0);
translate([0,0,$max+x]) cube(2*$max,center=true);
}
}
module top(x) {
difference() {
translate([0,0,-x]) child(0);
translate([0,0,-$max]) cube(2*$max,center=true);
}
}
//--------------------------------------------------------------------------------------
// modules to build simple greek columns
module capped_column (r1,r2,height,caps=0,delta=0) {
if (caps==0) { //none
cylinder(r1=r1,r2=r2,h=height+delta,center=true);
}
if (caps==1) // top
union() {
translate([0,0,-r2/2])
cylinder(r1=r1,r2=r2,h=height-r2+delta,center=true);
translate([0,0,height/2-r2-delta]) sphere(r2);
}
if (caps==2) // bottom
union() {
translate([0,0,r1/2])
cylinder(r1=r1,r2=r2,h=height-r1+delta,center=true);
translate([0,0,-(height/2 -r1-delta)]) sphere(r1);
}
if (caps==3) // both
union() {
cylinder(r1=r1,r2=r2,h=height-r1-r2,center=true);
translate([0,0,-(height/2 - r1-delta)]) sphere(r1);
translate([0,0,height/2 - r2-delta]) sphere(r2);
}
}
module tapered_column(r1,r2,height) {
cylinder(r1=r1,r2=r2,h=height,center=true);
}
module tapered_fluted_column(r1,r2,height,nflutes=20,arris=0,caps=0,delta=0.2) {
assign(flute_r1 = (1 - arris) * pi * r1 / nflutes,
flute_r2 = (1 - arris) * pi * r2 / nflutes,
taper = atan((r1-r2)/height)
)
{
echo("flute_r1",flute_r1,"flute_r2",flute_r2);
translate([0,0,height/2])
difference () {
tapered_column(r1=r1,r2=r2, height =height);
for (i = [1:nflutes]) {
rotate( [0,0,i *360 /nflutes])
translate([(r1+r2)/2,0,0])
rotate([0,-taper,0])
capped_column(r1=flute_r1,r2=flute_r2, height=height, caps=caps,delta=delta);
}
}
}
}
module slab(radius,height) {
translate([0,0,height/2])
cube([radius*2, radius*2,height],center=true);
}
module rounded_slab(radius,height,round) {
translate([0,0,height/2])
minkowski() {
cube([radius*2, radius*2,height],center=true);
sphere(round);
}
}
module fillet(radius, height) {
translate([0,0,height/2]) cylinder(r=radius,h=height,center=true);
}
module trocia (radius, height,offset) {
assign(trocia_radius = height/2)
translate([0,0,trocia_radius])
difference() {
cylinder(r=radius,h=height,center=true);
rotate_extrude(convexity = 10)
translate([radius+offset, 0, trocia_radius])
circle(r = trocia_radius);
}
}
module torus(radius, height) {
assign(torus_radius =height/2)
assign(inner_radius = radius - torus_radius) {
echo("torus_radius",torus_radius);
translate([0,0,torus_radius]) {
rotate_extrude(convexity = 10)
translate([inner_radius, 0, 0])
circle(torus_radius);
cylinder(r=inner_radius,h=height,center=true);
}
}
}
module stack (separations) {
union() {
for (i = [1:len(separations)]) {
assign(offset = v_sum(separations,i)) {
echo("i",i,"offset",offset);
translate ([0,0,offset])
child(i-1);
}
}
}
}
// a 20 sided straight fluted column with an attic base, and doric capital
module column() {
stack( [0,6,5,1,4,1,4,0.5,0.5,0.5,185,1,5,1,3]) {
// first an attic base
slab(20,6);
torus(20,5);
fillet(18,1);
trocia(17,4,0);
fillet(16,1);
torus(18,4);
fillet(16,0.5);
fillet(15,0.5);
fillet(14,0.5);
// then the fluted column
tapered_fluted_column( r1=13,r2=13,height=185,caps=0);
fillet(11,1); // hypertrachelium
tapered_fluted_column( r1=13,r2=13,height=5,,caps=1);
fillet(13,1);
// the echinus - bottum half of torus
bottom(3) torus (17,6);
// the abacus
slab(17,4);
}
}
facade() column();