Skip to content

Commit a2bced9

Browse files
committed
add thick border
1 parent 49e114f commit a2bced9

File tree

1 file changed

+82
-2
lines changed

1 file changed

+82
-2
lines changed

cases/case1.scad

Lines changed: 82 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ case_inner_padding_bottom = 4;
4040
/* [Case dimensions] */
4141

4242
// How round to make the case
43-
fillet_radius = 2.5;
43+
fillet_radius = 0;
44+
// fillet_radius = 2.5;
4445

4546
// Panel cover thickness
4647
panel_cover_depth = 1.6;
@@ -54,6 +55,17 @@ case_depth = 10.0;
5455
// Back plate thickness
5556
back_depth = 1.2;
5657

58+
/* [Thick border] */
59+
thick_border = false;
60+
thick_border_width = 12.0;
61+
thick_border_extra_depth = 15.0;
62+
63+
/* [Colors] */
64+
case_color = "yellow";
65+
panel_cover_color = "white";
66+
thick_border_color = "gray";
67+
kickstand_color = "white";
68+
5769
/* [Cable holes for panel] */
5870

5971
// Gap in the border for the eInk panel's cables, mm, centered
@@ -159,6 +171,11 @@ usb_cutout_hole_position = "top"; // [top, bottom, left, right, back]
159171
usb_cutout_hole_width = 14;
160172
usb_cutout_hole_height = 6.0;
161173

174+
// Tiny USB-C
175+
// usb_cutout_hole_width = 9.1;
176+
// usb_cutout_hole_height = 3.41;
177+
// usb_cutout_box_wall_thickness = 4.0;
178+
162179
/* [Hanging hole] */
163180

164181
hanging_hole = true;
@@ -215,7 +232,7 @@ side_button_hole_gap = 0.3;
215232
// Gap between STL parts for visual debugging
216233
debug_gap = 40;
217234
// Gap on baseplate between case and body when printing
218-
print_gap = 10;
235+
print_gap = 10 + (thick_border ? thick_border_width : 0);
219236
cross_section_percentage = 0; // [0:100]
220237

221238
// End of variables.
@@ -477,6 +494,26 @@ module caseBody () {
477494
}
478495
}
479496

497+
module caseThickBorder () {
498+
difference() {
499+
color(thick_border_color)
500+
translate([- thick_border_width, -thick_border_width, -thick_border_extra_depth + 0.01])
501+
cube([
502+
frame_full_width + 2 * thick_border_width,
503+
frame_full_height + 2 * thick_border_width,
504+
case_depth + back_depth + thick_border_extra_depth
505+
]);
506+
507+
color(thick_border_color)
508+
translate([0, 0, -thick_border_extra_depth - 11])
509+
cube([
510+
frame_full_width,
511+
frame_full_height,
512+
case_depth + back_depth + thick_border_extra_depth + 22
513+
]);
514+
}
515+
}
516+
480517
module case_cable_gaps() {
481518
if (panel_cable_gap_bottom > 0) {
482519
render_panel_cable_gap_bottom(case_cable_gap_depth, -0.11);
@@ -565,6 +602,7 @@ module case() {
565602
union() {
566603
if (case_center_support_vertical || case_center_support_horizontal) {
567604
difference() {
605+
color(case_color)
568606
union() {
569607
// Center support
570608
if (case_center_support_horizontal) {
@@ -597,6 +635,7 @@ module case() {
597635
};
598636

599637
if (usb_cutout) {
638+
color(case_color)
600639
cubeWithAngledTopBottom(
601640
loc=[
602641
(frame_full_width - usb_cutout_box_width - usb_cutout_box_wall_thickness * 2) * usb_cutout_offset_x_percentage / 100,
@@ -613,6 +652,7 @@ module case() {
613652
);
614653
}
615654
if (hanging_hole) {
655+
color(case_color)
616656
cubeWithAngledTopBottom(
617657
loc=[
618658
hanging_hole_x - hanging_hole_wall_thickness,
@@ -632,16 +672,24 @@ module case() {
632672
);
633673
}
634674
if (pi_pinholes) {
675+
color(case_color)
635676
piPinholes();
636677
}
637678

638679
// Cut out a piece of the cube
680+
color(case_color)
639681
caseBody();
682+
683+
if (thick_border) {
684+
color(thick_border_color)
685+
caseThickBorder();
686+
}
640687
};
641688

642689
// Cut holes to the back
643690
for (c = screw_positions) {
644691
// Screw thread hole that goes all the way
692+
color(case_color)
645693
translate([c[0], c[1], - 0.11])
646694
cylinder(d = case_screw_hole_thread_diameter,
647695
h = case_depth + back_depth + 0.11);
@@ -650,30 +698,35 @@ module case() {
650698

651699
if (hole_depth > case_screw_hole_diameter - case_screw_hole_thread_diameter) {
652700
// Cylinder hole from back to insert - chamfer
701+
color(case_color)
653702
translate([c[0], c[1], case_screw_hole_insert_depth + case_screw_hole_floor_depth]) // Solid border around the screw hole
654703
cylinder(d2 = case_screw_hole_diameter,
655704
d1 = case_screw_hole_thread_diameter,
656705
h = case_screw_hole_diameter - case_screw_hole_thread_diameter); // Hole for the screw thread
657706
// Cylinder hole from back to insert - tube
707+
color(case_color)
658708
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
659709
cylinder(d = case_screw_hole_diameter,
660710
h = hole_depth - (case_screw_hole_diameter - case_screw_hole_thread_diameter) + 0.11); // Hole for the screw thread
661711
} else {
662712
// Cylinder hole from back to insert
713+
color(case_color)
663714
translate([c[0], c[1], case_screw_hole_insert_depth + case_screw_hole_floor_depth]) // Solid border around the screw hole
664715
cylinder(d2 = case_screw_hole_diameter,
665716
d1 = case_screw_hole_thread_diameter,
666717
h = hole_depth); // Hole for the screw thread
667718
}
668719

669720
// Cylinder hole from front to insert
721+
color(case_color)
670722
translate([c[0], c[1], - 0.11]) // Solid border around the screw hole
671723
cylinder(d = case_screw_hole_diameter,
672724
h = case_screw_hole_insert_depth + 0.11); // Hole for the screw thread
673725
}
674726

675727
if (usb_cutout) {
676728
// Cutout into box
729+
color(case_color)
677730
cubeWithLeftRightGapBridge(
678731
loc=[
679732
(frame_full_width - usb_cutout_box_width - usb_cutout_box_wall_thickness * 2) * usb_cutout_offset_x_percentage / 100 + usb_cutout_box_wall_thickness,
@@ -691,6 +744,7 @@ module case() {
691744

692745
// Hole into what's remaining
693746
if (usb_cutout_hole_position == "left" || usb_cutout_hole_position == "right") {
747+
color(case_color)
694748
translate([
695749
(frame_full_width - usb_cutout_box_width - usb_cutout_box_wall_thickness * 2) * usb_cutout_offset_x_percentage / 100 + usb_cutout_box_wall_thickness - usb_cutout_box_wall_thickness - 0.11
696750
+ (usb_cutout_hole_position == "right" ? usb_cutout_box_width + usb_cutout_box_wall_thickness : 0),
@@ -703,6 +757,7 @@ module case() {
703757
usb_cutout_hole_height
704758
]);
705759
} else if (usb_cutout_hole_position == "top" || usb_cutout_hole_position == "bottom") {
760+
color(case_color)
706761
translate([
707762
(frame_full_width - usb_cutout_box_width - usb_cutout_box_wall_thickness * 2) * usb_cutout_offset_x_percentage / 100 + usb_cutout_box_wall_thickness + (usb_cutout_box_width - usb_cutout_hole_width) / 2,
708763
(frame_full_height - usb_cutout_box_height - usb_cutout_box_wall_thickness * 2) * usb_cutout_offset_y_percentage / 100 + usb_cutout_box_wall_thickness - usb_cutout_box_wall_thickness - 0.11
@@ -715,6 +770,7 @@ module case() {
715770
usb_cutout_hole_height
716771
]);
717772
} else if (usb_cutout_hole_position == "back") {
773+
color(case_color)
718774
translate([
719775
(frame_full_width - usb_cutout_box_width - usb_cutout_box_wall_thickness * 2) * usb_cutout_offset_x_percentage / 100 + usb_cutout_box_wall_thickness + (usb_cutout_box_width - usb_cutout_hole_width) / 2,
720776
(frame_full_height - usb_cutout_box_height - usb_cutout_box_wall_thickness * 2) * usb_cutout_offset_y_percentage / 100 + usb_cutout_box_wall_thickness - usb_cutout_box_wall_thickness - 0.11 + (usb_cutout_box_height - usb_cutout_hole_height) / 2 + usb_cutout_box_wall_thickness,
@@ -730,6 +786,7 @@ module case() {
730786
}
731787

732788
if (hanging_hole) {
789+
color(case_color)
733790
cubeWithAngledTopBottom(
734791
loc=[
735792
hanging_hole_x,
@@ -749,6 +806,7 @@ module case() {
749806
);
750807

751808
// Big cyclinter hole
809+
color(case_color)
752810
translate([
753811
hanging_hole_edge == "top" || hanging_hole_edge == "bottom"
754812
? frame_full_width / 2
@@ -766,6 +824,7 @@ module case() {
766824
cylinder(d = hanging_hole_large_diameter, h = back_depth + 0.21);
767825

768826
// Small cyclinter hole
827+
color(case_color)
769828
translate([
770829
hanging_hole_edge == "top" || hanging_hole_edge == "bottom"
771830
? frame_full_width / 2
@@ -783,6 +842,7 @@ module case() {
783842
cylinder(d = hanging_hole_small_diameter, h = back_depth + 0.21);
784843

785844
// Box connecitng the two
845+
color(case_color)
786846
translate([
787847
hanging_hole_edge == "top" || hanging_hole_edge == "bottom"
788848
? frame_full_width / 2 - hanging_hole_small_diameter / 2
@@ -804,9 +864,11 @@ module case() {
804864
}
805865

806866
if (rear_cooling) {
867+
color(case_color)
807868
rearCooling();
808869
}
809870

871+
color(case_color)
810872
sideButtonHoles();
811873
}
812874
}
@@ -857,6 +919,7 @@ module caseWithKickstand() {
857919
// Protective box around the kickstand legs
858920
for (x = leg_x_starts_full) {
859921
// Long base leg
922+
color(case_color)
860923
cubeWithAngledTopBottom(
861924
loc=[
862925
x,
@@ -870,6 +933,7 @@ module caseWithKickstand() {
870933
}
871934

872935
// Protective box around the leg bridge
936+
color(case_color)
873937
cubeWithAngledTopBottom(
874938
loc=[
875939
leg_x_starts_full[0] + kickstand_leg_full_width - kickstand_wall_thickness * 2,
@@ -888,6 +952,7 @@ module caseWithKickstand() {
888952
// Now the holes
889953
for (x = leg_x_starts_hole) {
890954
// Top thicker part - top extra cavity
955+
color(case_color)
891956
cubeWithAngledTopBottom(
892957
loc=[
893958
x,
@@ -902,6 +967,7 @@ module caseWithKickstand() {
902967
top=true
903968
);
904969
// Long base leg
970+
color(case_color)
905971
cubeWithLeftRightGapBridge(
906972
loc=[
907973
x,
@@ -919,6 +985,7 @@ module caseWithKickstand() {
919985
}
920986

921987
// Leg bridge hole
988+
color(case_color)
922989
cubeWithAngledTopBottom(
923990
loc=[
924991
leg_x_starts_full[0] + kickstand_leg_full_width - kickstand_wall_thickness - 0.11,
@@ -935,6 +1002,7 @@ module caseWithKickstand() {
9351002
);
9361003

9371004
if (sd_card_in_leg) {
1005+
color(case_color)
9381006
translate([sd_card_x_position, sd_card_y_position, 0])
9391007
rotate([0, 0, sd_card_in_leg_side_side == "left" ? 90 : -90])
9401008
sdCardAdapterCutout();
@@ -947,11 +1015,13 @@ module caseWithKickstand() {
9471015
// Legs
9481016
for (index=[0:1]) {
9491017
// Render the leg's top cylinder over the hinge
1018+
color(kickstand_color)
9501019
translate([leg_x_starts_leg[index], hinge_start[1], hinge_start[2]])
9511020
rotate([90, 0, 90])
9521021
cylinder(d = hinge_real_depth, h = kickstand_leg_width);
9531022

9541023
// Render the large leg top
1024+
color(kickstand_color)
9551025
translate([leg_x_starts_leg[index], hinge_start[1], hinge_start[2]])
9561026
rotate([kickstand_rotation, 0, 0])
9571027
cubeWithAngledTopBottom(
@@ -969,6 +1039,7 @@ module caseWithKickstand() {
9691039

9701040
// Render the large leg
9711041
difference() {
1042+
color(kickstand_color)
9721043
translate([leg_x_starts_leg[index], hinge_start[1], hinge_start[2]])
9731044
rotate([kickstand_rotation, 0, 0])
9741045
cubeWithAngledTopBottom(
@@ -985,14 +1056,17 @@ module caseWithKickstand() {
9851056
bottom=true
9861057
);
9871058
if (kickstand_inner_snap) {
1059+
color(kickstand_color)
9881060
translate([leg_x_starts_leg[index] + (index == (kickstand_inner_snap_reverse ? 1 : 0) ? kickstand_leg_width : 0), hinge_start[1], hinge_start[2] - kickstand_gap_thickness])
9891061
rotate([kickstand_rotation, 0, 0])
1062+
color(kickstand_color)
9901063
translate([0, kickstand_inner_snap_height_percentage / 100 * (kickstand_height - kickstand_gap_thickness - kickstand_wall_thickness * 2 - kickstand_gap_thickness - hinge_top_offset + kickstand_hinge_diameter - leg_depth), 0])
9911064
sphere(d = kickstand_inner_snap_radius_hole * 2);
9921065
}
9931066
}
9941067
}
9951068
// Render the leg bridge
1069+
color(kickstand_color)
9961070
translate([0, hinge_start[1], hinge_start[2]])
9971071
rotate([kickstand_rotation, 0, 0])
9981072
cubeWithAngledTopBottom(
@@ -1011,31 +1085,36 @@ module caseWithKickstand() {
10111085
);
10121086

10131087
if (sd_card_in_leg) {
1088+
color(case_color)
10141089
translate([sd_card_x_position, sd_card_y_position, 0])
10151090
rotate([0, 0, sd_card_in_leg_side_side == "left" ? 90 : -90])
10161091
sdCardAdapterBase();
10171092
}
10181093
}
10191094

10201095
// Render an empty cylinder inside the top cylinder, where the hinge will go through
1096+
color(kickstand_color)
10211097
translate([leg_x_starts_leg[0] - 0.11, hinge_start[1], hinge_start[2]])
10221098
rotate([90, 0, 90])
10231099
cylinder(d = kickstand_hinge_diameter + kickstand_hinge_cylinder_gap * 2, h = kickstand_width + 0.22);
10241100
}
10251101

10261102
for (index=[0:1]) {
10271103
// Render a cylinder as a hinge
1104+
color(case_color)
10281105
translate([leg_x_starts_full[index], hinge_start[1], hinge_start[2]])
10291106
rotate([90, 0, 90])
10301107
cylinder(d = kickstand_hinge_diameter, h = kickstand_leg_full_width - 0.22);
10311108

10321109
// Render the snaps for the legs
10331110
if (kickstand_inner_snap) {
1111+
color(case_color)
10341112
translate([
10351113
leg_x_starts_leg[index] + (index == (kickstand_inner_snap_reverse ? 1 : 0) ? kickstand_leg_width : 0) + (index == (kickstand_inner_snap_reverse ? 1 : 0) ? kickstand_inner_snap_gap : - kickstand_inner_snap_gap),
10361114
hinge_start[1] + kickstand_inner_snap_height_percentage / 100 * (kickstand_height - kickstand_gap_thickness - kickstand_wall_thickness * 2 - kickstand_gap_thickness - hinge_top_offset + kickstand_hinge_diameter - leg_depth),
10371115
hinge_start[2] - kickstand_gap_thickness
10381116
])
1117+
color(kickstand_color)
10391118
intersection() {
10401119
sphere(d = kickstand_inner_snap_radius_ball * 2);
10411120
translate([-kickstand_inner_snap_radius_hole * 2 + (index == (kickstand_inner_snap_reverse ? 1 : 0) ? 0 : +kickstand_inner_snap_radius_hole * 2), -kickstand_inner_snap_radius_hole * 2, -kickstand_inner_snap_radius_hole * 2])
@@ -1453,6 +1532,7 @@ module sideButtons() {
14531532
difference() {
14541533
union() {
14551534
// Cover panel
1535+
color(panel_cover_color)
14561536
rotate(
14571537
view_mode == "print_vertical"
14581538
? [180, 180, 180]

0 commit comments

Comments
 (0)