-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwire_shelf.scad
143 lines (110 loc) · 4.59 KB
/
wire_shelf.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
/* [General] */
// level of detail
fn = 90;
// distance between spool and case
gap_distance = 6;
// thickness of case walls
wall_size = 4;
// thickness of spool model
spool_thickness = 3;
// diameter for stick holding actual spool
spool_holder_diameter = 10;
screw_diameter = 3.5;
join_xyz = 16;
join_diameter = join_xyz/2;
module generateSpool(outer_diameter,inner_diameter,width) {
difference() {
union() {
translate([-1*(width/2)+1.5,0,0]) rotate([0,90,0])
cylinder(h=spool_thickness,d=outer_diameter,$fn=fn,center=true);
rotate([0,90,0])
cylinder(h=width,d=inner_diameter + spool_thickness,$fn=fn,center=true);
translate([(width/2)-1.5,0,0]) rotate([0,90,0])
cylinder(h=spool_thickness,d=outer_diameter,$fn=fn,center=true);
}
rotate([0,90,0])
cylinder(h=width+6,d=inner_diameter,$fn=fn,center=true);
}
}
module createBox(outer_diameter,inner_diameter,width) {
union() {
//add joining slots
createJoins(outer_diameter, inner_diameter,width);
//back wall
translate([0,0.5*outer_diameter+gap_distance+wall_size/2,-1*spool_holder_diameter])
cube([width+2*(gap_distance+wall_size),wall_size,outer_diameter+(2*gap_distance)+(2*wall_size)+spool_holder_diameter],center=true);
//bottom wall
translate([0,0,(outer_diameter/-2)-(gap_distance)-(0.5*wall_size)-spool_holder_diameter*1.5])
cube([width+2*(gap_distance+wall_size),outer_diameter+2*(gap_distance+wall_size),wall_size],center=true);
//left wall
wall_offset = width/2 + wall_size + gap_distance;
translate([-1*wall_offset,0,spool_holder_diameter*-0.5])
wall(outer_diameter,inner_diameter,width);
//right wall
translate([wall_offset,0,spool_holder_diameter*-0.5])
mirror([1,0,0])
wall(outer_diameter,inner_diameter,width);
}
}
module createJoins(outer_diameter, inner_diameter,width) {
y_offset = outer_diameter/2+gap_distance+join_xyz/2+wall_size;//+join_xyz+wall_size;
for (i_x = [-1, 1]){
x_offset = width/2+gap_distance+wall_size;
z_offset = (outer_diameter/-2)-(gap_distance)-wall_size-spool_holder_diameter*1.5+join_xyz/2;
for(i_z = [0,join_xyz*2.5]) {
echo(z_offset * i_z,x_offset*i_x,y_offset);
difference() {
if(i_z==0) {
color([0,1,0])
translate([x_offset*i_x,y_offset,z_offset+i_z])
cube([wall_size*2,join_xyz,join_xyz],center=true);
} else {
color([0,1,0])
translate([x_offset*i_x,y_offset-join_xyz/2,z_offset+i_z])
rotate([45,0,0])
cube([wall_size*2,join_xyz*1.5,join_xyz*1.5],center=true);
}
color([0,1,1])
translate([x_offset*i_x,y_offset,z_offset+i_z])
//cube([join_xyz*2,join_xyz,join_xyz/2],center=true);
rotate([0,90,0])
cylinder(r=join_xyz/4,h=join_xyz*2,center=true,$fn=fn);
}
}
}
}
module wall(outer_diameter,inner_diameter,width) {
difference() {
translate([0,0,spool_holder_diameter*-0.5])
cube([wall_size*2,outer_diameter+2*(gap_distance+wall_size),outer_diameter+(2*gap_distance)+(2*wall_size)+spool_holder_diameter],center=true);
translate([2,0,spool_holder_diameter*-1])
rotate([0,90,0])
cylinder(h=6,d=spool_holder_diameter,$fn=fn,center=true);
translate([2,0,spool_holder_diameter*-0.25])
cube([6,inner_diameter/2,spool_holder_diameter*1.25],center=true);
translate([2,outer_diameter/-2,outer_diameter/2])
rotate([45,0,0])
cube([6,inner_diameter*0.6,outer_diameter*3/2],center=true);
}
}
module spoolCaseWithLink(outer_diameter,inner_diameter,width) {
//generateSpool(outer_diameter,inner_diameter,width);
difference() {
translate([0,outer_diameter/-2,outer_diameter/2])
createBox(outer_diameter,inner_diameter,width);
//bottom screw hole 1
translate([0,-10,-5])
cylinder(h=50,d=screw_diameter,$fn=fn,center=true);
//bottom screw hole 2
translate([0,-3*outer_diameter/4,-5])
cylinder(h=50,d=screw_diameter,$fn=fn,center=true);
}
}
/*
translate([100,0,0])
spoolCaseWithLink(49,20,38);
spoolCaseWithLink(39,25,20);
translate([-100,0,0])
spoolCaseWithLink(128,20,58);
*/
spoolCaseWithLink(50,21,38);