Skip to content

Commit 0ddacc6

Browse files
committed
Reverted the variable name changes
- in the customizer the variable names and descriptions were redundant / almost identical.
1 parent fed19da commit 0ddacc6

1 file changed

Lines changed: 45 additions & 45 deletions

File tree

Cable duct.scad

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -24,42 +24,42 @@
2424

2525
/* [General settings] */
2626
// Cable duct overall length
27-
cable_duct_length = 70;
27+
cd_length = 70;
2828
// Cable duct width
29-
cable_duct_width = 10;
29+
cd_width = 10;
3030
// Cable duct height
31-
cable_duct_height = 10;
31+
cd_height = 10;
3232
// Number of fins
33-
cable_duct_fins = 8;
33+
cd_fins = 8;
3434
// Fin width
35-
cable_duct_fin_width = 3;
35+
cd_fin_width = 3;
3636
// Shell thickness (should be a multiple of your nozzle diameter)
37-
cable_duct_shell = 1.2;
37+
cd_shell = 1.2;
3838

3939
// Which part to create? Duct, cover or both.
4040
part = "both"; // [duct:Cable duct,cover:Duct top cover,both:Both parts]
4141

4242

4343
/* [Mounting feature settings] */
4444
// Mounting feature height
45-
mounting_feature_length = 2;
45+
mf_length = 2;
4646
// Mounting feature angle
47-
mounting_feature_angle = 45;
47+
mf_angle = 45;
4848
// Mounting feature depth
49-
mounting_feature_depth = 0.8;
49+
mf_depth = 0.8;
5050
// Mounting feature offset from top
51-
mounting_feature_top_offset = 0.6;
51+
mf_top_offset = 0.6;
5252
// Tolerance between cover and duct
53-
mounting_feature_tolerance = 0.15;
53+
mf_top_tolerance = 0.15;
5454

5555
/* [Hidden] */
5656
// the color
5757
col = [0.3,0.5,0.85];
5858
// safety offset for boolean operations, prevents spurious surfaces
5959
s = 0.01;
6060

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;
61+
cd_fin_spacing = (cd_length - cd_fin_width) / cd_fins;
62+
cd_slit_width = cd_fin_spacing - cd_fin_width;
6363

6464

6565
// Create the part
@@ -89,15 +89,15 @@ module print_part()
8989
module clip_profile()
9090
{
9191
// Make the the angle is properly defined and does not lead to geometry errors
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,
92+
assert(mf_angle > 0, "The angle must be greater than 0 deg.");
93+
assert(mf_angle <= 90, "The angle cannot be greater than 90 deg.");
94+
assert(mf_depth*tan(90-mf_angle)*2 <= mf_length,
9595
"The mounting feature length is too small. Increase length or the angle.");
9696

9797
polyp = [[0,0],
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)]];
98+
[0,-mf_length],
99+
[mf_depth,-mf_length+mf_depth*tan(90-mf_angle)],
100+
[mf_depth,-mf_depth*tan(90-mf_angle)]];
101101
polygon(polyp);
102102
}
103103

@@ -107,13 +107,13 @@ module clip_profile()
107107
*/
108108
module inner_duct_profile()
109109
{
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]]);
110+
cd_hwidth = cd_width/2;
111+
polygon([[cd_hwidth-mf_depth-cd_shell, cd_height+s],
112+
[cd_hwidth-mf_depth-cd_shell, cd_height-mf_length-mf_top_offset],
113+
[cd_hwidth-cd_shell, cd_height-mf_length-mf_top_offset-mf_depth*tan(45)],
114+
[cd_hwidth-cd_shell, cd_shell],
115+
[0, cd_shell],
116+
[0, cd_height+s]]);
117117
}
118118

119119
/*
@@ -129,15 +129,15 @@ module create_duct_profile()
129129
difference() {
130130
difference() {
131131
difference() {
132-
scale([cable_duct_width, cable_duct_height])
132+
scale([cd_width, cd_height])
133133
translate([-0.5, 0])
134134
square(1, center=false);
135135

136136
union() {
137-
translate([-cable_duct_width/2-s, cable_duct_height-mounting_feature_top_offset])
137+
translate([-cd_width/2-s, cd_height-mf_top_offset])
138138
clip_profile();
139139

140-
translate([cable_duct_width/2+s, cable_duct_height-mounting_feature_top_offset])
140+
translate([cd_width/2+s, cd_height-mf_top_offset])
141141
mirror([1, 0])
142142
clip_profile();
143143
}
@@ -158,21 +158,21 @@ module create_duct_profile()
158158
module create_cover_profile()
159159
{
160160
union() {
161-
translate([cable_duct_width/2+mounting_feature_tolerance, cable_duct_height-mounting_feature_top_offset, 0])
161+
translate([cd_width/2+mf_top_tolerance, cd_height-mf_top_offset, 0])
162162
mirror([1, 0])
163163
clip_profile();
164164

165-
translate([-cable_duct_width/2-mounting_feature_tolerance, cable_duct_height-mounting_feature_top_offset, 0])
165+
translate([-cd_width/2-mf_top_tolerance, cd_height-mf_top_offset, 0])
166166
clip_profile();
167167

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],
168+
polygon([[cd_width/2+mf_top_tolerance, cd_height-mf_top_offset-mf_length],
169+
[cd_width/2+mf_top_tolerance, cd_height+mf_top_tolerance],
170+
[-cd_width/2-mf_top_tolerance, cd_height+mf_top_tolerance],
171+
[-cd_width/2-mf_top_tolerance, cd_height-mf_top_offset-mf_length],
172+
[-cd_width/2-mf_top_tolerance-cd_shell, cd_height-mf_top_offset-mf_length],
173+
[-cd_width/2-mf_top_tolerance-cd_shell, cd_height+mf_top_tolerance+cd_shell],
174+
[cd_width/2+mf_top_tolerance+cd_shell, cd_height+mf_top_tolerance+cd_shell],
175+
[cd_width/2+mf_top_tolerance+cd_shell, cd_height-mf_top_offset-mf_length],
176176
]);
177177
}
178178
}
@@ -186,14 +186,14 @@ module create_duct()
186186
color(col)
187187
rotate(90, [1, 0, 0])
188188
difference() {
189-
linear_extrude(height=cable_duct_length, center=false)
189+
linear_extrude(height=cd_length, center=false)
190190
create_duct_profile();
191191

192192

193193
union() {
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]);
194+
for (i = [0:cd_fins-1]) {
195+
translate([-cd_width/2-1, 3*cd_shell, i*cd_fin_spacing+cd_fin_width])
196+
cube([cd_width+2, cd_height+1, cd_fin_spacing-cd_fin_width]);
197197
}
198198
}
199199
}
@@ -207,9 +207,9 @@ module create_duct()
207207
module create_cover()
208208
{
209209
color(col)
210-
translate([2*cable_duct_width, 0, cable_duct_height+mounting_feature_tolerance+cable_duct_shell])
210+
translate([2*cd_width, 0, cd_height+mf_top_tolerance+cd_shell])
211211
rotate(180, [0, 1, 0])
212212
rotate(90, [1, 0, 0])
213-
linear_extrude(height=cable_duct_length, center=false)
213+
linear_extrude(height=cd_length, center=false)
214214
create_cover_profile();
215215
}

0 commit comments

Comments
 (0)