-
Notifications
You must be signed in to change notification settings - Fork 2
/
dentist_square.scad
89 lines (71 loc) · 1.57 KB
/
dentist_square.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
// Quad from Dentist's office
// Edge width
_EdgeWidth = 3.5;
// Small Square Width/Depth
_SmallSquareWD = 18.5;
// Small Square Height
_SmallSquareH = 2;
// Big Square Width/Depth
_BigSquareWD = 28.5;
// Big Square Height
_BigSquareH = 2.6;
// SmallSquare Space
_SmallSquareSpace = 22.5;
// Rim Width
_RimWidth = 0.4;
// Render hollow square of width and depth WD, height H, edges of EdgeWidth
module HollowSquare(WD, H, EdgeWidth)
{
difference()
{
// Matter
{
cube([WD, WD, H], center=false);
}
// Anti-matter
{
translate([EdgeWidth, EdgeWidth, 0])
{
cube([WD - (2 * EdgeWidth), WD - (2 * EdgeWidth), H + .01], center=false);
}
}
}
}
module HollowSquareWithRim(WD, H, EdgeWidth, RimWidth)
{
HollowSquare(WD, H, EdgeWidth);
translate([0, 0, H])
{
HollowSquare(WD, 0.2, RimWidth);
}
}
module FourHollowSquares(WD, H, Space, EdgeWidth, RimWidth)
{
for (x = [0 : 1])
{
for (y = [0 : 1])
{
translate([x * Space, y * Space, 0])
{
HollowSquareWithRim(WD, H, EdgeWidth, RimWidth);
}
}
}
}
module FiveSquare(SmallWD, BigWD, SmallH, BigH, Space, EdgeWidth, RimWidth)
{
Center = (Space + SmallWD) / 2;
union()
{
FourHollowSquares(SmallWD, SmallH, Space, EdgeWidth, RimWidth);
translate([Center - BigWD / 2, Center - BigWD / 2, 0])
{
HollowSquareWithRim(BigWD, BigH, EdgeWidth, RimWidth);
}
}
}
module main()
{
FiveSquare(_SmallSquareWD, _BigSquareWD, _SmallSquareH, _BigSquareH, _SmallSquareSpace, _EdgeWidth, _RimWidth);
}
main();