-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmoonecase_3.scad
123 lines (90 loc) · 2.79 KB
/
moonecase_3.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
Length = 100;
Width = 60;
Height = 45;
Thickness = 5;
wall_thickness = Thickness; //wall thickness
include <screw_holes.scad>
module outer_wall()
{
color("yellow",0.25)
cube([Length,Width,Height]);
}
module inner_wall()
{
inner_length = Length - (wall_thickness * 2);
inner_width = Width - (wall_thickness * 2);
inner_height = Height - (wall_thickness);
difference() {
outer_wall();
translate([wall_thickness,wall_thickness,wall_thickness ])
cube([inner_length, inner_width, inner_height + wall_thickness]);
}
}
// -----------------------------------------------------------
// Screw stuff...
screw = 3.5; // diameter in mm
Screw_Post_Offset = 3; // screw post offset (options: 0.001, 1, 2, 3, 4)
scpo_height = Height;
scpo_radius = screw;
//scpo_diameter = screw * 2;
scpo_diameter = screw * 3;
scpo_inset_offset = Thickness + scpo_radius;
// x1,y1,x2,y2
function get_abs_screw_stand_insets() = [scpo_inset_offset,scpo_inset_offset,Length - scpo_inset_offset,Width - scpo_inset_offset];
module screw_stand_single()
{
// So a single screw "stand" is "screw pitch * 2" in diameter.
difference()
{
cylinder(scpo_height,d=scpo_diameter);
// n-1
//cylinder(scpo_height,d=screw);
shd = get_screw_hole_diameter_mm(screw);
echo("Screw pitch vs hole diameter:",screw,shd);
cylinder(scpo_height,d=get_screw_hole_diameter_mm(screw));
}
}
module screw_stands()
{
translator(0,0,-0.2){screw_stand_single();}
}
module inner_screw_stands()
{
// Bottom left:
//echo("Bottom Left:",[ scpo_inset_offset ,scpo_inset_offset]);
translate([ scpo_inset_offset ,scpo_inset_offset, 0])
screw_stand_single();
// Bottom Right
//echo("Bottom Right:",[ Length - scpo_inset_offset ,scpo_inset_offset]);
translate([ Length - scpo_inset_offset ,scpo_inset_offset, 0])
screw_stand_single();
// Top Left
//echo("Top Left:",[ scpo_inset_offset ,Width - scpo_inset_offset]);
translate([ scpo_inset_offset ,Width - scpo_inset_offset, 0])
screw_stand_single();
// Top Right
//echo("Top Right:",[ Length - scpo_inset_offset ,Width - scpo_inset_offset]);
translate([ Length - scpo_inset_offset ,Width - scpo_inset_offset, 0])
screw_stand_single();
}
module in_screw_stand_single()
{
difference()
{
cylinder(Post_Height,d=Mount_Screw_Diameter*2,center=true);
cylinder(Post_Height,d=Mount_Screw_Diameter,center=true);
}
}
module shell() {
lid_inset = Thickness / 2;
difference()
{
union ()
{
inner_wall();
inner_screw_stands();
};
translate ([lid_inset / 2,lid_inset / 2,Height - Thickness])
cube([Length - lid_inset,Width - lid_inset,Thickness]);
}
}