-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcard_holder.scad
75 lines (64 loc) · 2.33 KB
/
card_holder.scad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
include <Roundedcube.scad>;
$fn=60;
//Card Sizes
card_width=63.5;
card_height=89;
card_thickness=.32;
cards=60;
extra=10;
corner_radius=3;
//Structure
bottom_thickness=2;
bottom_width=11;
card_frame_thickness=4;
external_radius=2;
external_corner_radius=7;
//Consts
render_offset=1; //used to offset parts to ensure clarity of zero size lines
//Computed Values
overall_width=card_frame_thickness * 2 + card_width;
overall_height=card_frame_thickness * 2 + card_height;
cards_thickness=(card_thickness*cards)+extra;
overall_thickness=bottom_thickness+cards_thickness;
module corner_cut(radius = 1, height = 1, rotation = [0,0,0]){
rotate(rotation){
difference(){
translate([-1,-1,-1]){
cube([radius+1, radius+1, height+2]);
}
translate([radius,radius,-2]){
cylinder(r = radius, h = height+4);
}
}
}
}
difference(){
roundedcube([overall_width,overall_height,overall_thickness], false, external_radius);
//Bottom Cutout
translate([bottom_width,bottom_width,-render_offset]){
roundedcube([overall_width - 2 * bottom_width,overall_height - 2 * bottom_width,bottom_thickness + 2*render_offset],
false, external_radius);
}
//Card Cutout
translate([card_frame_thickness,card_frame_thickness,bottom_thickness]){
roundedcube([card_width,card_height,overall_thickness + 10], false, corner_radius, "zmax");
}
//Side_Cuts
translate([bottom_width,-corner_radius,bottom_thickness]){
roundedcube([overall_width - 2 * bottom_width, overall_height + 2 * corner_radius, cards_thickness], false, corner_radius, "zmin");
}
translate([-corner_radius,bottom_width,bottom_thickness]){
roundedcube([overall_width + 2 * corner_radius , overall_height - 2 * bottom_width, cards_thickness], false, corner_radius, "zmin");
}
//Extra rounded cuts to fit box
corner_cut(radius = external_corner_radius, height = overall_thickness);
translate([overall_width,0,0]){
corner_cut(radius = external_corner_radius, height = overall_thickness,rotation = [0,0,90]);
}
translate([overall_width,overall_height,0]){
corner_cut(radius = external_corner_radius, height = overall_thickness,rotation = [0,0,180]);
}
translate([0,overall_height,0]){
corner_cut(radius = external_corner_radius, height = overall_thickness,rotation = [0,0,-90]);
}
}