/
mksSbasePlate.scad
108 lines (89 loc) · 2.37 KB
/
mksSbasePlate.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
// MKS SBASE holder.
//
// This work is licensed under a Creative Commons Attribution-ShareAlike 4.0
// International License.
// Visit: http://creativecommons.org/licenses/by-sa/4.0/
//
// Louis Dionne
// louis.dionne@gmail.com
$fn=360/6;
include <configuration.scad>;
include <roundedBox.scad>;
// All measurements in mm.
debug = false;
xSize = 146;
ySize = 95.2;
zSize = 3;
zPcBoard = 1.5;
pillarHeight = 7 - zPcBoard;
edgeWidth = 15;
outsideEdge = 5;
// MKS SBASE holes.
upperLeft = [ 4, ySize-4];
upperRight = [xSize-4, ySize-4];
lowerLeft = [ 4, 4];
lowerRight = [xSize-4, 4];
module mksSbasePlate()
{
difference()
{
if (debug)
translate([0, 0, pillarHeight])
%cube([xSize, ySize, zPcBoard]);
union()
{
// Make the body.
translate([xSize/2, ySize/2, zSize/2])
roundedBox([xSize+outsideEdge,
ySize+outsideEdge,
zSize], 5, true);
// Add two tabs for M5x8 screws to attach to the aluminum
// extrusions.
translate([xSize/2, extrusionWidth/2-2.5, zSize/2])
roundedBox([xSize+2*extrusionWidth,
extrusionWidth,
zSize],
5, true);
// Add four pillars to elevate the PCB slightly.
addPillar(upperLeft);
addPillar(upperRight);
addPillar(lowerLeft);
addPillar(lowerRight);
}
// Make two M5x8 screw holes in the two tabs.
translate([-extrusionWidth/2, extrusionWidth/2-2.5, 0])
m5x8();
translate([xSize+extrusionWidth/2, extrusionWidth/2-2.5, 0])
m5x8();
// Remove a cutout in the center.
translate([xSize/2, ySize/2, zSize/2])
translate([0, 5, 0])
roundedBox([xSize-edgeWidth,
ySize-edgeWidth - 5,
zSize+smidge],
5, true);
// Make four M3x6 screw holes in the four pillars.
m3x6(upperLeft);
m3x6(upperRight);
m3x6(lowerLeft);
m3x6(lowerRight);
}
}
module addPillar(pos)
{
translate([pos[0], pos[1], 0])
cylinder(r=m3LooseHeadRadius, h=pillarHeight);
}
module m3x6(pos)
{
// These holes need to be slightly tight.
translate([pos[0], pos[1], -smidge/2])
cylinder(r1=m3Radius-smidge, r2=m3Radius, h=pillarHeight+smidge);
}
module m5x8()
{
// These holes should be loose.
translate([0, 0, -smidge/2])
cylinder(r=m5LooseRadius, h=pillarHeight+smidge);
}
mksSbasePlate();