-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cw_box.scad
132 lines (117 loc) · 3.23 KB
/
cw_box.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
// (c) 2014 juewei@fabfolk.com
//
// counterweight box for bambi trebuchet
use <bbox.scad>
d1=8; // bolt diameter for gluing walls
module cw_box_handle(wn=1.5,hn=3,l=400,bw=174,bz=27,h=450)
{
w = bw*wn;
difference()
{
union()
{
translate([-53/2,-w/2,0]) bbox(53,34,h,bz=3);
translate([-53/2, w/2-34,0]) bbox(53,34,h,bz=3);
translate([-53/2,-w/2+34,h-80]) bbox(53,20,80,bz=3);
translate([-53/2, w/2-34-20,h-80]) bbox(53,20,80,bz=3);
translate([ 53/2,-w/2,0]) bbox(44,w,44,by=3);
translate([-44-53/2,-w/2,0]) bbox(44,w,44,by=3);
}
// hole for rear shaft
translate([0,0,h-80/2]) rotate([90,0,0]) translate([0,0,-w/2-10]) cylinder(w+20,8,8);
// base bolt holes, glued
translate([0, w/2-34/2,44/2]) rotate([0,90,0]) translate([0,0,-100]) cylinder(200,5,5);
translate([0,-w/2+34/2,44/2]) rotate([0,90,0]) translate([0,0,-100]) cylinder(200,5,5);
}
}
module cw_box_floor(wn,l,bw,bz)
{
w=wn*bw;
w2 = floor(wn)*bw;
translate([-l/2, -w/2, 0]) difference()
{
union()
{
for (y = [0 : bw : w-bw])
{
translate([0,y,0]) bbox(l,bw,bz,bx=3);
}
if (w2 < w)
{
translate([0,w2,0]) bbox(l,w-w2,bz,bx=3);
}
}
translate([l/2-(53+1)/2, -10,-10]) cube([53+1,34+1+10,bz+20]);
translate([l/2-(53+1)/2, w-34-1,-10]) cube([53+1,34+1+10,bz+20]);
}
}
module cw_box_long_wall(l, bw, hn, bz)
{
alpha=25;
h = hn*bw;
h2 = floor(hn)*bw;
difference()
{
union()
{
for (y = [0 : bw : h-bw])
{
translate([0,0,y]) bbox(l+2*bz,bz,bw,bx=3,bz=3);
}
if (h2 < h)
{
translate([0,0,h2]) bbox(l+2*bz,bz,h-h2,bx=3,bz=3);
}
}
translate([0,0,44-5]) rotate([0,alpha,0]) translate([0,-10,-10-44]) cube([120,bz+20,10+44]);
translate([l+2*bz,0,44-5]) rotate([0,90-alpha,0]) translate([0,-10,-120]) cube([44+10,bz+20,120]);
for (y = [20 : 40 : h])
{
for (x = [bz/2 : (l+bz)/2 : l+2*bz])
{
translate([x,-10,y]) rotate([-90,0,0]) cylinder(bz+20, d1/2, d1/2);
}
}
for (x = [50 : 40 : l/2])
{
translate([x,-10,44+bz/2]) rotate([-90,0,0]) cylinder(bz+20, d1/2, d1/2);
translate([l+2*bz-x,-10,44+bz/2]) rotate([-90,0,0]) cylinder(bz+20, d1/2, d1/2);
}
}
}
module cw_box_short_wall(w, bw, hn, bz)
{
alpha=25;
h = hn*bw;
h2 = floor(hn)*bw;
difference()
{
union()
{
for (y = [0 : bw : h-bw])
{
translate([0,0,y]) bbox(bz,w,bw,by=3);
}
if (h2 < h)
{
translate([0,0,h2]) bbox(bz,w,h-h2,by=3);
}
}
translate([0,0,44-5]) rotate([0,alpha,0]) translate([0,-10,-10-44]) cube([44+10,w+20,10+44]);
for (y = [20 : 40 : w])
{
translate([-10,y,44+bz/2]) rotate([0,90,0]) cylinder(bz+20, d1/2, d1/2);
}
}
}
module cw_box(wn=2,hn=2.7,l=470,bw=120,bz=27,h=520)
{
w=wn*bw;
translate([0,0,44]) cw_box_floor(wn,l,bw,bz);
cw_box_handle(wn,hn,l,bw,bz,h);
translate([-l/2-bz,w/2 ,0]) cw_box_long_wall(l, bw, hn, bz);
translate([-l/2-bz,-w/2-bz,0]) cw_box_long_wall(l, bw, hn, bz);
translate([-l/2-bz,-w/2 ,0]) cw_box_short_wall(w, bw, hn, bz);
translate([ l/2+bz,-w/2 ,0]) scale([-1,1,1]) cw_box_short_wall(w, bw, hn, bz);
}
cw_box();