Skip to content

Commit

Permalink
Reverted the variable name changes
Browse files Browse the repository at this point in the history
- in the customizer the variable names and descriptions were redundant /
almost identical.
  • Loading branch information
RealNagus committed Jul 28, 2019
1 parent fed19da commit 0ddacc6
Showing 1 changed file with 45 additions and 45 deletions.
90 changes: 45 additions & 45 deletions Cable duct.scad
Original file line number Diff line number Diff line change
Expand Up @@ -24,42 +24,42 @@

/* [General settings] */
// Cable duct overall length
cable_duct_length = 70;
cd_length = 70;
// Cable duct width
cable_duct_width = 10;
cd_width = 10;
// Cable duct height
cable_duct_height = 10;
cd_height = 10;
// Number of fins
cable_duct_fins = 8;
cd_fins = 8;
// Fin width
cable_duct_fin_width = 3;
cd_fin_width = 3;
// Shell thickness (should be a multiple of your nozzle diameter)
cable_duct_shell = 1.2;
cd_shell = 1.2;

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


/* [Mounting feature settings] */
// Mounting feature height
mounting_feature_length = 2;
mf_length = 2;
// Mounting feature angle
mounting_feature_angle = 45;
mf_angle = 45;
// Mounting feature depth
mounting_feature_depth = 0.8;
mf_depth = 0.8;
// Mounting feature offset from top
mounting_feature_top_offset = 0.6;
mf_top_offset = 0.6;
// Tolerance between cover and duct
mounting_feature_tolerance = 0.15;
mf_top_tolerance = 0.15;

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

cd_fin_spacing = (cable_duct_length - cable_duct_fin_width) / cable_duct_fins;
cd_slit_width = cd_fin_spacing - cable_duct_fin_width;
cd_fin_spacing = (cd_length - cd_fin_width) / cd_fins;
cd_slit_width = cd_fin_spacing - cd_fin_width;


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

polyp = [[0,0],
[0,-mounting_feature_length],
[mounting_feature_depth,-mounting_feature_length+mounting_feature_depth*tan(90-mounting_feature_angle)],
[mounting_feature_depth,-mounting_feature_depth*tan(90-mounting_feature_angle)]];
[0,-mf_length],
[mf_depth,-mf_length+mf_depth*tan(90-mf_angle)],
[mf_depth,-mf_depth*tan(90-mf_angle)]];
polygon(polyp);
}

Expand All @@ -107,13 +107,13 @@ module clip_profile()
*/
module inner_duct_profile()
{
cd_hwidth = cable_duct_width/2;
polygon([[cd_hwidth-mounting_feature_depth-cable_duct_shell, cable_duct_height+s],
[cd_hwidth-mounting_feature_depth-cable_duct_shell, cable_duct_height-mounting_feature_length-mounting_feature_top_offset],
[cd_hwidth-cable_duct_shell, cable_duct_height-mounting_feature_length-mounting_feature_top_offset-mounting_feature_depth*tan(45)],
[cd_hwidth-cable_duct_shell, cable_duct_shell],
[0, cable_duct_shell],
[0, cable_duct_height+s]]);
cd_hwidth = cd_width/2;
polygon([[cd_hwidth-mf_depth-cd_shell, cd_height+s],
[cd_hwidth-mf_depth-cd_shell, cd_height-mf_length-mf_top_offset],
[cd_hwidth-cd_shell, cd_height-mf_length-mf_top_offset-mf_depth*tan(45)],
[cd_hwidth-cd_shell, cd_shell],
[0, cd_shell],
[0, cd_height+s]]);
}

/*
Expand All @@ -129,15 +129,15 @@ module create_duct_profile()
difference() {
difference() {
difference() {
scale([cable_duct_width, cable_duct_height])
scale([cd_width, cd_height])
translate([-0.5, 0])
square(1, center=false);

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

translate([cable_duct_width/2+s, cable_duct_height-mounting_feature_top_offset])
translate([cd_width/2+s, cd_height-mf_top_offset])
mirror([1, 0])
clip_profile();
}
Expand All @@ -158,21 +158,21 @@ module create_duct_profile()
module create_cover_profile()
{
union() {
translate([cable_duct_width/2+mounting_feature_tolerance, cable_duct_height-mounting_feature_top_offset, 0])
translate([cd_width/2+mf_top_tolerance, cd_height-mf_top_offset, 0])
mirror([1, 0])
clip_profile();

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

polygon([[cable_duct_width/2+mounting_feature_tolerance, cable_duct_height-mounting_feature_top_offset-mounting_feature_length],
[cable_duct_width/2+mounting_feature_tolerance, cable_duct_height+mounting_feature_tolerance],
[-cable_duct_width/2-mounting_feature_tolerance, cable_duct_height+mounting_feature_tolerance],
[-cable_duct_width/2-mounting_feature_tolerance, cable_duct_height-mounting_feature_top_offset-mounting_feature_length],
[-cable_duct_width/2-mounting_feature_tolerance-cable_duct_shell, cable_duct_height-mounting_feature_top_offset-mounting_feature_length],
[-cable_duct_width/2-mounting_feature_tolerance-cable_duct_shell, cable_duct_height+mounting_feature_tolerance+cable_duct_shell],
[cable_duct_width/2+mounting_feature_tolerance+cable_duct_shell, cable_duct_height+mounting_feature_tolerance+cable_duct_shell],
[cable_duct_width/2+mounting_feature_tolerance+cable_duct_shell, cable_duct_height-mounting_feature_top_offset-mounting_feature_length],
polygon([[cd_width/2+mf_top_tolerance, cd_height-mf_top_offset-mf_length],
[cd_width/2+mf_top_tolerance, cd_height+mf_top_tolerance],
[-cd_width/2-mf_top_tolerance, cd_height+mf_top_tolerance],
[-cd_width/2-mf_top_tolerance, cd_height-mf_top_offset-mf_length],
[-cd_width/2-mf_top_tolerance-cd_shell, cd_height-mf_top_offset-mf_length],
[-cd_width/2-mf_top_tolerance-cd_shell, cd_height+mf_top_tolerance+cd_shell],
[cd_width/2+mf_top_tolerance+cd_shell, cd_height+mf_top_tolerance+cd_shell],
[cd_width/2+mf_top_tolerance+cd_shell, cd_height-mf_top_offset-mf_length],
]);
}
}
Expand All @@ -186,14 +186,14 @@ module create_duct()
color(col)
rotate(90, [1, 0, 0])
difference() {
linear_extrude(height=cable_duct_length, center=false)
linear_extrude(height=cd_length, center=false)
create_duct_profile();


union() {
for (i = [0:cable_duct_fins-1]) {
translate([-cable_duct_width/2-1, 3*cable_duct_shell, i*cd_fin_spacing+cable_duct_fin_width])
cube([cable_duct_width+2, cable_duct_height+1, cd_fin_spacing-cable_duct_fin_width]);
for (i = [0:cd_fins-1]) {
translate([-cd_width/2-1, 3*cd_shell, i*cd_fin_spacing+cd_fin_width])
cube([cd_width+2, cd_height+1, cd_fin_spacing-cd_fin_width]);
}
}
}
Expand All @@ -207,9 +207,9 @@ module create_duct()
module create_cover()
{
color(col)
translate([2*cable_duct_width, 0, cable_duct_height+mounting_feature_tolerance+cable_duct_shell])
translate([2*cd_width, 0, cd_height+mf_top_tolerance+cd_shell])
rotate(180, [0, 1, 0])
rotate(90, [1, 0, 0])
linear_extrude(height=cable_duct_length, center=false)
linear_extrude(height=cd_length, center=false)
create_cover_profile();
}

0 comments on commit 0ddacc6

Please sign in to comment.