3dprint: increase fit tolerances
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
$fa = 1;
|
||||
$fs = 0.4;
|
||||
|
||||
wiggle_room = 0.3;
|
||||
|
||||
epsilon = 0.01;
|
||||
text_depth = 0.4;
|
||||
button_thickness = 3;
|
||||
switch_shaft_upper = 3;
|
||||
switch_shaft_lower = 3.5;
|
||||
switch_shaft_upper = 3 + wiggle_room;
|
||||
switch_shaft_lower = 3.5 + wiggle_room;
|
||||
switch_shaft_length = 8.8;
|
||||
shaft_outer = 7;
|
||||
shaft_length = 5;
|
||||
@@ -36,12 +38,16 @@ module button_text(label, width, height, thickness, size=4) {
|
||||
halign="center", valign="center", size=size);
|
||||
}
|
||||
|
||||
buttons = ["HDG", "LNAV", "ALT", "VNAV",
|
||||
"VS", "FLC", "SPD", "APR",
|
||||
"LVL", "FD", "AP", "A/T", "N1"];
|
||||
buttons = ["HDG"];
|
||||
buttons_small = [""];
|
||||
|
||||
//buttons = ["HDG", "LNAV", "ALT", "VNAV",
|
||||
// "VS", "FLC", "SPD", "APR",
|
||||
// "LVL", "FD", "AP", "A/T", "N1"];
|
||||
//buttons_small = ["", "", "c/o"];
|
||||
|
||||
button_width = 15;
|
||||
button_height = 8;
|
||||
buttons_small = ["", "", "c/o"];
|
||||
button_small_width = 8;
|
||||
button_small_height = 8;
|
||||
|
||||
@@ -68,22 +74,22 @@ for (i = [0:len(buttons)-1]) {
|
||||
}
|
||||
}
|
||||
|
||||
for (i = [0:len(buttons_small)-1]) {
|
||||
translate([(i%row_length)*(button_small_width+print_spacing),
|
||||
floor(i/row_length)*(button_small_height+print_spacing)+80, 0]) {
|
||||
if (render_text && render_button) {
|
||||
color("black")
|
||||
button(buttons_small[i], button_small_width, button_small_height,
|
||||
size=3);
|
||||
color("white")
|
||||
button_text(buttons_small[i], button_small_width,
|
||||
button_small_height, text_depth, size=3);
|
||||
} else if (render_button) {
|
||||
button(buttons_small[i], button_small_width, button_small_height, size=3);
|
||||
} else if (render_text) {
|
||||
button_text(buttons_small[i], button_small_width, button_small_height,
|
||||
text_depth, size=3);
|
||||
}
|
||||
}
|
||||
}
|
||||
//for (i = [0:len(buttons_small)-1]) {
|
||||
// translate([(i%row_length)*(button_small_width+print_spacing),
|
||||
// floor(i/row_length)*(button_small_height+print_spacing)+80, 0]) {
|
||||
// if (render_text && render_button) {
|
||||
// color("black")
|
||||
// button(buttons_small[i], button_small_width, button_small_height,
|
||||
// size=3);
|
||||
// color("white")
|
||||
// button_text(buttons_small[i], button_small_width,
|
||||
// button_small_height, text_depth, size=3);
|
||||
// } else if (render_button) {
|
||||
// button(buttons_small[i], button_small_width, button_small_height, size=3);
|
||||
// } else if (render_text) {
|
||||
// button_text(buttons_small[i], button_small_width, button_small_height,
|
||||
// text_depth, size=3);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ $fs = 0.4;
|
||||
panel_border = 5;
|
||||
panel_width = 160 + 2*panel_border;
|
||||
panel_height = 100 + 2*panel_border;
|
||||
panel_thick = 1;
|
||||
panel_thick = 1.5;
|
||||
|
||||
led_diam = 3;
|
||||
button_width = 15;
|
||||
@@ -19,7 +19,7 @@ guide_thick = 0.5;
|
||||
guide_height = 2;
|
||||
guide_length = 3;
|
||||
|
||||
wiggle_room = 0.1;
|
||||
wiggle_room = 0.3;
|
||||
epsilon = 0.01;
|
||||
|
||||
module cutout_rect(left, upper, width, height) {
|
||||
@@ -46,28 +46,28 @@ module screw_point(c_x, c_y, length = 5) {
|
||||
difference() {
|
||||
cylinder(r=5.2/2+1, h=length);
|
||||
translate([0, 0, -epsilon])
|
||||
cylinder(r=5.2/2, $fn=6, h=2+epsilon);
|
||||
cylinder(r=(5.2+wiggle_room)/2, $fn=6, h=2+epsilon);
|
||||
}
|
||||
}
|
||||
|
||||
module button_guide(c_x, c_y, width, height) {
|
||||
translate([c_x + panel_border - width/2 - wiggle_room - guide_thick,
|
||||
panel_height - panel_border - c_y - height/2 - wiggle_room - guide_thick, -panel_thick-guide_height/2]) {
|
||||
panel_height - panel_border - c_y - height/2 - wiggle_room - guide_thick, -1-guide_height/2]) {
|
||||
cube([guide_length, guide_thick, guide_height]);
|
||||
cube([guide_thick, guide_length, guide_height]);
|
||||
}
|
||||
translate([c_x + panel_border + width/2 + wiggle_room,
|
||||
panel_height - panel_border - c_y - height/2 - wiggle_room - guide_thick, -panel_thick-guide_height/2]) {
|
||||
panel_height - panel_border - c_y - height/2 - wiggle_room - guide_thick, -1-guide_height/2]) {
|
||||
translate([-guide_length+guide_thick, 0, 0]) cube([guide_length, guide_thick, guide_height]);
|
||||
cube([guide_thick, guide_length, guide_height]);
|
||||
}
|
||||
translate([c_x + panel_border - width/2 - wiggle_room - guide_thick,
|
||||
panel_height - panel_border - c_y + height/2 + wiggle_room, -panel_thick-guide_height/2]) {
|
||||
panel_height - panel_border - c_y + height/2 + wiggle_room, -1-guide_height/2]) {
|
||||
cube([guide_length, guide_thick, guide_height]);
|
||||
translate([0, -guide_length+guide_thick, 0]) cube([guide_thick, guide_length, guide_height]);
|
||||
}
|
||||
translate([c_x + panel_border + width/2 + wiggle_room,
|
||||
panel_height - panel_border - c_y + height/2 + wiggle_room, -panel_thick-guide_height/2]) {
|
||||
panel_height - panel_border - c_y + height/2 + wiggle_room, -1-guide_height/2]) {
|
||||
translate([-guide_length+guide_thick, 0, 0]) cube([guide_length, guide_thick, guide_height]);
|
||||
translate([0, -guide_length+guide_thick, 0]) cube([guide_thick, guide_length, guide_height]);
|
||||
}
|
||||
@@ -146,8 +146,8 @@ module panel() {
|
||||
translate([panel_width, 100+panel_border+top_border/2-2.5, -5]) rotate([0, -90, 0]) screw_block();
|
||||
|
||||
//color("green") translate([panel_border, panel_border, -12]) cube([160, 100, 1]); // dummy PCB
|
||||
translate([0, -bottom_border, 0]) cube([panel_width, bottom_border, 1]);
|
||||
translate([0, panel_height, 0]) cube([panel_width, top_border, 1]);
|
||||
translate([0, -bottom_border, 0]) cube([panel_width, bottom_border, panel_thick]);
|
||||
translate([0, panel_height, 0]) cube([panel_width, top_border, panel_thick]);
|
||||
rotate([0, -90, 0]) translate([0, 0, -panel_width+panel_thick]) linear_extrude(height=panel_width-panel_thick)
|
||||
polygon([[0, panel_height+top_border], [1, panel_height+top_border],
|
||||
[0, panel_height+top_border+panel_thick/tan(panel_angle)+epsilon]]);
|
||||
@@ -155,13 +155,13 @@ module panel() {
|
||||
|
||||
module screw_block() {
|
||||
difference() {
|
||||
cube([5, 5, 10]);
|
||||
translate([2.5, 2.5, -epsilon]) cylinder(r=1, h=8+epsilon);
|
||||
cube([5, 5, 12]);
|
||||
translate([2.5, 2.5, -epsilon]) cylinder(r=1+wiggle_room/2, h=10+epsilon);
|
||||
}
|
||||
}
|
||||
|
||||
side_screw_head_diam = 5.9;
|
||||
side_screw_shaft_diam = 3;
|
||||
side_screw_head_diam = 5.9+wiggle_room;
|
||||
side_screw_shaft_diam = 3+wiggle_room;
|
||||
side_screw_head_height = 2.7;
|
||||
|
||||
module side(rightside = false) {
|
||||
@@ -206,19 +206,19 @@ module side(rightside = false) {
|
||||
}
|
||||
}
|
||||
|
||||
render_panel = false;
|
||||
render_case = true;
|
||||
render_panel = true;
|
||||
render_case = false;
|
||||
|
||||
mount_screw_diam = 4;
|
||||
mount_screw_head_diam = 6.7;
|
||||
mount_screw_diam = 4+wiggle_room;
|
||||
mount_screw_head_diam = 6.7+wiggle_room;
|
||||
mount_screw_head_height = 2.3;
|
||||
|
||||
if (render_panel) {
|
||||
if (render_panel && !render_case) {
|
||||
rotate([180, 0, 0]) panel();
|
||||
} else if (render_panel && render_case) {
|
||||
rotate([panel_angle, 0, 0]) {
|
||||
// panel part
|
||||
panel();
|
||||
#panel();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -235,16 +235,16 @@ if (render_case) {
|
||||
cube([panel_width, top_shelf + cos(panel_angle)*(panel_height+bottom_border+top_border), 1]);
|
||||
|
||||
translate([0, (panel_height+top_border)*cos(panel_angle), (panel_height+top_border)*sin(panel_angle)-epsilon])
|
||||
translate([0, -panel_thick*sin(panel_angle), -panel_thick*cos(panel_angle)])
|
||||
cube([panel_width, top_shelf+panel_thick*sin(panel_angle), 1]);
|
||||
translate([0, -0.5*panel_thick*sin(panel_angle), -panel_thick*cos(panel_angle)])
|
||||
cube([panel_width, top_shelf+0.5*panel_thick*sin(panel_angle), panel_thick]);
|
||||
translate([0, (panel_height+top_border)*cos(panel_angle)+top_shelf-panel_thick,
|
||||
-bottom_border*sin(panel_angle)+panel_thick])
|
||||
cube([panel_width, 1+epsilon,
|
||||
(panel_height+bottom_border+top_border)*sin(panel_angle)-3*panel_thick*cos(panel_angle)]);
|
||||
-bottom_border*sin(panel_angle)+panel_thick*cos(panel_angle)])
|
||||
cube([panel_width, panel_thick+epsilon,
|
||||
(panel_height+bottom_border+top_border)*sin(panel_angle)-2*panel_thick*cos(panel_angle)]);
|
||||
}
|
||||
rotate([panel_angle, 0, 0]) {
|
||||
translate([0, -bottom_border-epsilon, 0]) cube([panel_width, 2*panel_thick+epsilon, 1]);
|
||||
translate([0, panel_height+top_border-panel_thick, 0]) cube([panel_width, 2*panel_thick+epsilon, 1]);
|
||||
translate([-wiggle_room, panel_height+top_border-panel_thick, 0]) cube([panel_width+2*wiggle_room, 2*panel_thick+epsilon, 1]);
|
||||
}
|
||||
|
||||
translate([18-panel_thick, 28, -bottom_border*sin(panel_angle)-2]) {
|
||||
@@ -254,7 +254,17 @@ if (render_case) {
|
||||
translate([2*40+54, 0, 0]) mount_hole();
|
||||
}
|
||||
}
|
||||
difference() {
|
||||
union() {
|
||||
side();
|
||||
translate([panel_width, 0, 0]) side(true);
|
||||
translate([panel_width+panel_thick-2*epsilon, 0, 0]) side(true);
|
||||
}
|
||||
rotate([panel_angle, 0, 0]) {
|
||||
translate([-wiggle_room, -bottom_border-panel_thick, 0])
|
||||
cube ([wiggle_room+epsilon, panel_height+top_border+bottom_border+2*panel_thick, panel_thick]);
|
||||
translate([panel_width-epsilon, -bottom_border-panel_thick, 0])
|
||||
cube ([wiggle_room, panel_height+top_border+bottom_border+2*panel_thick, panel_thick+epsilon]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user