Skip to content

Commit fed19da

Browse files
committed
Bugfixes
- Typo fixed - renamed the variables for better readability in the Thingiverse Customizer
1 parent efdf03d commit fed19da

1 file changed

Lines changed: 52 additions & 53 deletions

File tree

Cable duct.scad

Lines changed: 52 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Create your own custom cable duct with desired dimensions and matching top cover.
66
*
7-
* Created by Thomas Heßling <mail@dream-dimensions.de>.
7+
* Created by Thomas Hessling <mail@dream-dimensions.de>.
88
* License: Creative Commons - Attribution - Non-Commercial - Share Alike
99
*
1010
* https://www.dream-dimensions.de
@@ -20,47 +20,46 @@
2020
* Define the cable duct's final dimensions.
2121
* All values are millimetres.
2222
*/
23+
24+
2325
/* [General settings] */
2426
// Cable duct overall length
25-
cd_length = 70;
27+
cable_duct_length = 70;
2628
// Cable duct width
27-
cd_width = 10;
29+
cable_duct_width = 10;
2830
// Cable duct height
29-
cd_height = 10;
31+
cable_duct_height = 10;
3032
// Number of fins
31-
cd_fins = 8;
32-
// Fin width (approximate)
33-
cd_fin_width = 3;
33+
cable_duct_fins = 8;
34+
// Fin width
35+
cable_duct_fin_width = 3;
3436
// Shell thickness (should be a multiple of your nozzle diameter)
35-
cd_shell = 1.2;
37+
cable_duct_shell = 1.2;
3638

3739
// Which part to create? Duct, cover or both.
38-
part = "both"; // [duct:Cable duct,cover:Duct top cove,both:Both parts"]
40+
part = "both"; // [duct:Cable duct,cover:Duct top cover,both:Both parts]
3941

4042

41-
/* [Advanced settings] */
43+
/* [Mounting feature settings] */
4244
// Mounting feature height
43-
mf_length = 2;
45+
mounting_feature_length = 2;
4446
// Mounting feature angle
45-
mf_angle = 45;
47+
mounting_feature_angle = 45;
4648
// Mounting feature depth
47-
mf_depth = 0.8;
49+
mounting_feature_depth = 0.8;
4850
// Mounting feature offset from top
49-
mf_top_offset = 0.6;
51+
mounting_feature_top_offset = 0.6;
5052
// Tolerance between cover and duct
51-
tol = 0.15;
52-
53+
mounting_feature_tolerance = 0.15;
5354

5455
/* [Hidden] */
5556
// the color
5657
col = [0.3,0.5,0.85];
5758
// safety offset for boolean operations, prevents spurious surfaces
5859
s = 0.01;
59-
// smoothness
60-
$fn = 128;
6160

62-
cd_fin_spacing = (cd_length - cd_fin_width) / cd_fins;
63-
cd_slit_width = cd_fin_spacing - cd_fin_width;
61+
cd_fin_spacing = (cable_duct_length - cable_duct_fin_width) / cable_duct_fins;
62+
cd_slit_width = cd_fin_spacing - cable_duct_fin_width;
6463

6564

6665
// Create the part
@@ -90,15 +89,15 @@ module print_part()
9089
module clip_profile()
9190
{
9291
// Make the the angle is properly defined and does not lead to geometry errors
93-
assert(mf_angle > 0, "The angle must be greater than 0 deg.");
94-
assert(mf_angle <= 90, "The angle cannot be greater than 90 deg.");
95-
assert(mf_depth*tan(90-mf_angle)*2 <= mf_length,
92+
assert(mounting_feature_angle > 0, "The angle must be greater than 0 deg.");
93+
assert(mounting_feature_angle <= 90, "The angle cannot be greater than 90 deg.");
94+
assert(mounting_feature_depth*tan(90-mounting_feature_angle)*2 <= mounting_feature_length,
9695
"The mounting feature length is too small. Increase length or the angle.");
9796

9897
polyp = [[0,0],
99-
[0,-mf_length],
100-
[mf_depth,-mf_length+mf_depth*tan(90-mf_angle)],
101-
[mf_depth,-mf_depth*tan(90-mf_angle)]];
98+
[0,-mounting_feature_length],
99+
[mounting_feature_depth,-mounting_feature_length+mounting_feature_depth*tan(90-mounting_feature_angle)],
100+
[mounting_feature_depth,-mounting_feature_depth*tan(90-mounting_feature_angle)]];
102101
polygon(polyp);
103102
}
104103

@@ -108,13 +107,13 @@ module clip_profile()
108107
*/
109108
module inner_duct_profile()
110109
{
111-
cd_hwidth = cd_width/2;
112-
polygon([[cd_hwidth-mf_depth-cd_shell, cd_height+s],
113-
[cd_hwidth-mf_depth-cd_shell, cd_height-mf_length-mf_top_offset],
114-
[cd_hwidth-cd_shell, cd_height-mf_length-mf_top_offset-mf_depth*tan(45)],
115-
[cd_hwidth-cd_shell, cd_shell],
116-
[0, cd_shell],
117-
[0, cd_height+s]]);
110+
cd_hwidth = cable_duct_width/2;
111+
polygon([[cd_hwidth-mounting_feature_depth-cable_duct_shell, cable_duct_height+s],
112+
[cd_hwidth-mounting_feature_depth-cable_duct_shell, cable_duct_height-mounting_feature_length-mounting_feature_top_offset],
113+
[cd_hwidth-cable_duct_shell, cable_duct_height-mounting_feature_length-mounting_feature_top_offset-mounting_feature_depth*tan(45)],
114+
[cd_hwidth-cable_duct_shell, cable_duct_shell],
115+
[0, cable_duct_shell],
116+
[0, cable_duct_height+s]]);
118117
}
119118

120119
/*
@@ -130,15 +129,15 @@ module create_duct_profile()
130129
difference() {
131130
difference() {
132131
difference() {
133-
scale([cd_width, cd_height])
132+
scale([cable_duct_width, cable_duct_height])
134133
translate([-0.5, 0])
135134
square(1, center=false);
136135

137136
union() {
138-
translate([-cd_width/2-s, cd_height-mf_top_offset])
137+
translate([-cable_duct_width/2-s, cable_duct_height-mounting_feature_top_offset])
139138
clip_profile();
140139

141-
translate([cd_width/2+s, cd_height-mf_top_offset])
140+
translate([cable_duct_width/2+s, cable_duct_height-mounting_feature_top_offset])
142141
mirror([1, 0])
143142
clip_profile();
144143
}
@@ -159,21 +158,21 @@ module create_duct_profile()
159158
module create_cover_profile()
160159
{
161160
union() {
162-
translate([cd_width/2+tol, cd_height-mf_top_offset, 0])
161+
translate([cable_duct_width/2+mounting_feature_tolerance, cable_duct_height-mounting_feature_top_offset, 0])
163162
mirror([1, 0])
164163
clip_profile();
165164

166-
translate([-cd_width/2-tol, cd_height-mf_top_offset, 0])
165+
translate([-cable_duct_width/2-mounting_feature_tolerance, cable_duct_height-mounting_feature_top_offset, 0])
167166
clip_profile();
168167

169-
polygon([[cd_width/2+tol, cd_height-mf_top_offset-mf_length],
170-
[cd_width/2+tol, cd_height+tol],
171-
[-cd_width/2-tol, cd_height+tol],
172-
[-cd_width/2-tol, cd_height-mf_top_offset-mf_length],
173-
[-cd_width/2-tol-cd_shell, cd_height-mf_top_offset-mf_length],
174-
[-cd_width/2-tol-cd_shell, cd_height+tol+cd_shell],
175-
[cd_width/2+tol+cd_shell, cd_height+tol+cd_shell],
176-
[cd_width/2+tol+cd_shell, cd_height-mf_top_offset-mf_length],
168+
polygon([[cable_duct_width/2+mounting_feature_tolerance, cable_duct_height-mounting_feature_top_offset-mounting_feature_length],
169+
[cable_duct_width/2+mounting_feature_tolerance, cable_duct_height+mounting_feature_tolerance],
170+
[-cable_duct_width/2-mounting_feature_tolerance, cable_duct_height+mounting_feature_tolerance],
171+
[-cable_duct_width/2-mounting_feature_tolerance, cable_duct_height-mounting_feature_top_offset-mounting_feature_length],
172+
[-cable_duct_width/2-mounting_feature_tolerance-cable_duct_shell, cable_duct_height-mounting_feature_top_offset-mounting_feature_length],
173+
[-cable_duct_width/2-mounting_feature_tolerance-cable_duct_shell, cable_duct_height+mounting_feature_tolerance+cable_duct_shell],
174+
[cable_duct_width/2+mounting_feature_tolerance+cable_duct_shell, cable_duct_height+mounting_feature_tolerance+cable_duct_shell],
175+
[cable_duct_width/2+mounting_feature_tolerance+cable_duct_shell, cable_duct_height-mounting_feature_top_offset-mounting_feature_length],
177176
]);
178177
}
179178
}
@@ -187,14 +186,14 @@ module create_duct()
187186
color(col)
188187
rotate(90, [1, 0, 0])
189188
difference() {
190-
linear_extrude(height=cd_length, center=false)
189+
linear_extrude(height=cable_duct_length, center=false)
191190
create_duct_profile();
192191

193192

194193
union() {
195-
for (i = [0:cd_fins-1]) {
196-
translate([-cd_width/2-1, 3*cd_shell, i*cd_fin_spacing+cd_fin_width])
197-
cube([cd_width+2, cd_height+1, cd_fin_spacing-cd_fin_width]);
194+
for (i = [0:cable_duct_fins-1]) {
195+
translate([-cable_duct_width/2-1, 3*cable_duct_shell, i*cd_fin_spacing+cable_duct_fin_width])
196+
cube([cable_duct_width+2, cable_duct_height+1, cd_fin_spacing-cable_duct_fin_width]);
198197
}
199198
}
200199
}
@@ -208,9 +207,9 @@ module create_duct()
208207
module create_cover()
209208
{
210209
color(col)
211-
translate([2*cd_width, 0, cd_height+tol+cd_shell])
210+
translate([2*cable_duct_width, 0, cable_duct_height+mounting_feature_tolerance+cable_duct_shell])
212211
rotate(180, [0, 1, 0])
213212
rotate(90, [1, 0, 0])
214-
linear_extrude(height=cd_length, center=false)
213+
linear_extrude(height=cable_duct_length, center=false)
215214
create_cover_profile();
216-
}
215+
}

0 commit comments

Comments
 (0)