Skip to content

Commit a5e8b6a

Browse files
committed
fix holes
1 parent b140580 commit a5e8b6a

2 files changed

Lines changed: 80 additions & 39 deletions

File tree

cases/case1.scad

Lines changed: 67 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -577,10 +577,25 @@ module case() {
577577
cylinder(d = case_screw_hole_thread_diameter,
578578
h = case_depth + back_depth + 0.11);
579579

580-
// Cylinder hole from back to insert
581-
translate([c[0], c[1], case_screw_hole_insert_depth + case_screw_hole_floor_depth]) // Solid border around the screw hole
582-
cylinder(d = case_screw_hole_diameter,
583-
h = case_depth + back_depth - case_screw_hole_insert_depth - case_screw_hole_floor_depth + 0.11); // Hole for the screw thread
580+
hole_depth = case_depth + back_depth - case_screw_hole_insert_depth - case_screw_hole_floor_depth + 0.11;
581+
582+
if (hole_depth > case_screw_hole_diameter - case_screw_hole_thread_diameter) {
583+
// Cylinder hole from back to insert - chamfer
584+
translate([c[0], c[1], case_screw_hole_insert_depth + case_screw_hole_floor_depth]) // Solid border around the screw hole
585+
cylinder(d2 = case_screw_hole_diameter,
586+
d1 = case_screw_hole_thread_diameter,
587+
h = case_screw_hole_diameter - case_screw_hole_thread_diameter); // Hole for the screw thread
588+
// Cylinder hole from back to insert - tube
589+
translate([c[0], c[1], case_screw_hole_insert_depth + case_screw_hole_floor_depth + (case_screw_hole_diameter - case_screw_hole_thread_diameter) - 0.01]) // Solid border around the screw hole
590+
cylinder(d = case_screw_hole_diameter,
591+
h = hole_depth - (case_screw_hole_diameter - case_screw_hole_thread_diameter) + 0.11); // Hole for the screw thread
592+
} else {
593+
// Cylinder hole from back to insert
594+
translate([c[0], c[1], case_screw_hole_insert_depth + case_screw_hole_floor_depth]) // Solid border around the screw hole
595+
cylinder(d2 = case_screw_hole_diameter,
596+
d1 = case_screw_hole_thread_diameter,
597+
h = hole_depth); // Hole for the screw thread
598+
}
584599

585600
// Cylinder hole from front to insert
586601
translate([c[0], c[1], - 0.11]) // Solid border around the screw hole
@@ -590,7 +605,7 @@ module case() {
590605

591606
if (usb_cutout) {
592607
// Cutout into box
593-
cubeWithAngledTopBottom(
608+
cubeWithLeftRightGapBridge(
594609
loc=[
595610
(frame_full_width - usb_cutout_box_width - usb_cutout_box_wall_thickness * 2) * usb_cutout_offset_x_percentage / 100 + usb_cutout_box_wall_thickness,
596611
(frame_full_height - usb_cutout_box_height - usb_cutout_box_wall_thickness * 2) * usb_cutout_offset_y_percentage / 100 + usb_cutout_box_wall_thickness,
@@ -775,18 +790,19 @@ module caseWithKickstand() {
775790
top=true
776791
);
777792
// Long base leg
778-
cubeWithAngledTopBottom(
793+
cubeWithLeftRightGapBridge(
779794
loc=[
780795
x,
781796
frame_full_height - kickstand_bottom_start - kickstand_height + kickstand_wall_thickness,
782797
case_depth + back_depth - kickstand_depth - kickstand_gap_thickness + kickstand_wall_thickness
783798
],
784799
size=[
785800
kickstand_leg_width + 2 * kickstand_gap_thickness,
786-
kickstand_height - 2 * kickstand_wall_thickness - leg_depth,
801+
kickstand_height - 2 * kickstand_wall_thickness - (kickstand_depth - kickstand_wall_thickness + kickstand_gap_thickness),
787802
kickstand_depth - kickstand_wall_thickness + kickstand_gap_thickness + 0.11
788803
],
789-
bottom=true
804+
bottom=true,
805+
gap_width=0.4
790806
);
791807
}
792808

@@ -873,35 +889,8 @@ module caseWithKickstand() {
873889
translate([leg_x_starts_leg[0] - 0.11, hinge_start[1], hinge_start[2]])
874890
rotate([90, 0, 90])
875891
cylinder(d = kickstand_hinge_diameter + kickstand_hinge_cylinder_gap * 2, h = kickstand_width + 0.22);
876-
877-
// Render an empty cylinder into the feet of the kickstand
878-
for (x = leg_x_starts_leg) {
879-
translate([0, hinge_start[1], hinge_start[2]])
880-
rotate([kickstand_rotation, 0, 0])
881-
translate([
882-
x - 0.11,
883-
frame_full_height - kickstand_bottom_start - kickstand_gap_thickness * 3 - hinge_start[1],
884-
case_depth + back_depth - hinge_start[2] - leg_depth / 2
885-
])
886-
rotate([90, 0, 90])
887-
cylinder(d = leg_depth * 0.75, h = kickstand_leg_width + 0.22);
888-
}
889892
}
890893

891-
// Do not print this for vertical prints, as the legs will get stuck into it
892-
if (view_mode != "print_vertical") {
893-
// Render an full cylinder into the frame to snap the legs into
894-
for (x = leg_x_starts_hole) {
895-
translate([
896-
x - 0.11,
897-
frame_full_height - kickstand_bottom_start - kickstand_gap_thickness * 2,
898-
case_depth + back_depth - hinge_real_depth / 4
899-
])
900-
rotate([90, 0, 90])
901-
cylinder(d = hinge_real_depth / 3, h = kickstand_leg_width + 0.22 + kickstand_gap_thickness * 2);
902-
}
903-
}
904-
905894
// Render a cylinder as a hinge
906895
for (x = leg_x_starts_full) {
907896
translate([x, hinge_start[1], hinge_start[2]])
@@ -957,7 +946,13 @@ module filletBoxBottom(x, y, z, r = fillet_radius) {
957946
}
958947
}
959948

960-
module cubeWithAngledTopBottom(loc, size, top=false, topReverse=false, bottom=false, bottomReverse=false, left=false, leftReverse=false, right=false, rightReverse=false) {
949+
module cubeWithAngledTopBottom(
950+
loc, size,
951+
top=false, topReverse=false,
952+
bottom=false, bottomReverse=false,
953+
left=false, leftReverse=false,
954+
right=false, rightReverse=false
955+
) {
961956
translate(loc)
962957
cube(size);
963958

@@ -997,6 +992,42 @@ module cubeWithAngledTopBottom(loc, size, top=false, topReverse=false, bottom=fa
997992
}
998993
}
999994

995+
module cubeWithLeftRightGapBridge(
996+
loc, size,
997+
top=false, topReverse=false,
998+
bottom=false, bottomReverse=false,
999+
left=false, leftReverse=false,
1000+
right=false, rightReverse=false,
1001+
gap_width = 0.4
1002+
) {
1003+
if (size[0] < size[1]) {
1004+
cubeWithAngledTopBottom(
1005+
[loc[0] + gap_width, loc[1], loc[2]],
1006+
[size[0] - gap_width * 2, size[1], size[2]],
1007+
top, topReverse,
1008+
bottom, bottomReverse,
1009+
left, leftReverse,
1010+
right, rightReverse
1011+
);
1012+
} else {
1013+
cubeWithAngledTopBottom(
1014+
[loc[0], loc[1] + gap_width, loc[2]],
1015+
[size[0], size[1] - gap_width * 2, size[2]],
1016+
top, topReverse,
1017+
bottom, bottomReverse,
1018+
left, leftReverse,
1019+
right, rightReverse
1020+
);
1021+
}
1022+
cubeWithAngledTopBottom(
1023+
[loc[0], loc[1], loc[2] + gap_width],
1024+
[size[0], size[1], size[2] - gap_width],
1025+
top, topReverse,
1026+
bottom, bottomReverse,
1027+
left, leftReverse,
1028+
right, rightReverse
1029+
);
1030+
}
10001031

10011032
/*****************************************************************************/
10021033
/* Rendering */

cases/waveshare.13in3e.scad

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ extra_screws_left = [0.333, 0.667, 0, 0, 0];
3939
extra_screws_right = [0.17, 0.83, 0, 0, 0];
4040

4141
/* [Center support] */
42-
case_center_support_vertical = true;
43-
case_center_support_horizontal = true;
42+
case_center_support_vertical = false;
43+
case_center_support_horizontal = false;
4444

4545
/* [Kickstand] */
4646
kickstand = true;
@@ -52,10 +52,20 @@ kickstand_depth = 6.7;
5252

5353
/* [USB cutout] */
5454
usb_cutout = true;
55+
usb_cutout_box_depth = 6.5;
56+
57+
// Vertical hole
5558
usb_cutout_offset_x_percentage = 10;
5659
usb_cutout_offset_y_percentage = 18;
5760
usb_cutout_box_height = 55;
58-
usb_cutout_box_depth = 6.5;
61+
62+
// // Horizontal hole
63+
// usb_cutout_offset_x_percentage = 10;
64+
// usb_cutout_offset_y_percentage = 12;
65+
// usb_cutout_box_width = 55;
66+
// usb_cutout_box_height = 20;
67+
// usb_cutout_hole_position = "right"; // [top, bottom, left, right, back]
68+
5969

6070
/* [Hanging hole] */
6171
hanging_hole = true;

0 commit comments

Comments
 (0)