-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathy-slider-carriage.scad
126 lines (120 loc) · 4.77 KB
/
y-slider-carriage.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
124
125
126
include <constants.scad>;
use <vslot.scad>;
sectionCountWidth=2;
sectionCountDepth=1;
screwDiameter=5;
tolerance=.8;
wallWidth=2 + tolerance/2;
profileSize=20;
sideNum = 2;
allTogether = true;
diagonalSeparation=false;
isOpen = true;
sideWidth = 1;
backWidth = 7;
holeDistWidth=60;
holeDistHeight=51.9;
blockHeight = wallWidth*2 + sectionCountWidth*profileSize;
blockWidth = (isOpen ? backWidth : sideWidth) + sideWidth + sectionCountDepth*profileSize;
cubeX = holeDistHeight+screwDiameter+2*wallWidth;
cubeZ = holeDistWidth+screwDiameter+2*wallWidth;
difference() {
hull() {
translate([wallWidth+screwDiameter/2, 0, wallWidth+screwDiameter/2])
{
rotate([-90,0,0])
cylinder(r=wallWidth+screwDiameter/2,h=blockWidth, $fn=90);
translate([0, 0, holeDistWidth])
rotate([-90,0,0])
cylinder(r=wallWidth+screwDiameter/2,h=blockWidth, $fn=90);
}
translate([wallWidth+screwDiameter/2 + holeDistHeight, 0, wallWidth+screwDiameter/2])
{
rotate([-90,0,0])
cylinder(r=wallWidth+screwDiameter/2,h=blockWidth, $fn=90);
translate([0, 0, holeDistWidth])
rotate([-90,0,0])
cylinder(r=wallWidth+screwDiameter/2,h=blockWidth, $fn=90);
}
};
translate([wallWidth+screwDiameter/2, 0, wallWidth+screwDiameter/2])
{
rotate([-90,0,0])
cylinder(r=screwDiameter/2,h=blockWidth, $fn=90);
translate([0, 0, holeDistWidth])
rotate([-90,0,0])
cylinder(r=screwDiameter/2,h=blockWidth, $fn=90);
}
translate([wallWidth+screwDiameter/2 + holeDistHeight, 0, wallWidth+screwDiameter/2])
{
rotate([-90,0,0])
cylinder(r=screwDiameter/2,h=blockWidth, $fn=90);
translate([0, 0, holeDistWidth])
rotate([-90,0,0])
cylinder(r=screwDiameter/2,h=blockWidth, $fn=90);
}
translate([(cubeX-(sectionCountWidth*profileSize))/2,sideWidth,0])
drawVslotExtrusion(
height=cubeZ,
sectionCountWidth=sectionCountWidth,
sectionCountDepth=sectionCountDepth,
topIndent=true,
rightIndent=true,
leftIndent=true,
bottomIndent=!isOpen,
oversize=tolerance,
//screwOffset,
topScrewPoints = [cubeZ/2]
//rightScrewPoints = [],
//topScrewPoints = [],
//bottomScrewPoints = [],
//backScrewPoints = []
);
if (isOpen) {
translate([(cubeX-(sectionCountWidth*profileSize)-tolerance)/2,0,0])
cube([sectionCountWidth*profileSize + tolerance, sideWidth, cubeZ]);
};
if (allTogether != true)
{
if (diagonalSeparation == true)
{
//translate ([sideNum == 1 ? 0 : cubeX, 0, 0])
if (sideNum == 1) {
linear_extrude(h=cubeZ)
polygon(points=[
[0,sideWidth-tolerance/2],
[(cubeX-(sectionCountWidth*profileSize))/2-tolerance/2,sideWidth-tolerance/2],
[cubeX-(cubeX-(sectionCountWidth*profileSize))/2+tolerance/2,blockWidth-sideWidth+tolerance/2],
[cubeX+tolerance/2, blockWidth-sideWidth+tolerance/2],
[cubeX+tolerance/2, blockWidth+tolerance/2],
[0, blockWidth]
]);
}
else {
linear_extrude(h=cubeZ)
polygon(points=[
[0,-tolerance],
[0,sideWidth-tolerance/2],
[(cubeX-(sectionCountWidth*profileSize))/2-tolerance/2,sideWidth-tolerance/2],
[cubeX-(cubeX-(sectionCountWidth*profileSize))/2+tolerance/2,blockWidth-sideWidth+tolerance/2],
[cubeX+tolerance/2, blockWidth-sideWidth+tolerance/2],
[cubeX+tolerance, blockWidth+tolerance/2],
[cubeX+tolerance, -tolerance]
]);
}
}
else
{
translate([sideNum == 1 ? 0 : (screwDiameter/2+profileSize+(profileSize-indentWidthOutside)/2),0,0])
cube([blockHeight-screwDiameter-(profileSize-indentWidthOutside)/2,blockWidth,cubeZ]);
}
};
/*
translate([-(holeDistHeight-blockHeight)/2+holeDistHeight, 0, cylinderRadius])
rotate([-90,0,0])
cylinder(r=cylinderRadius,h=blockWidth, $fn=90);
translate([-(holeDistHeight-blockHeight)/2+holeDistHeight, 0, cylinderRadius+holeDistWidth])
rotate([-90,0,0])
cylinder(r=cylinderRadius,h=blockWidth, $fn=90);
*/
}