-
Notifications
You must be signed in to change notification settings - Fork 28
/
tslot.scad
134 lines (115 loc) · 3.44 KB
/
tslot.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
127
128
129
130
131
132
133
134
// t-slot helper modules
//
// (c) 2013 Metamáquina <http://www.metamaquina.com.br/>
//
// Author:
// * Felipe C. da S. Sanches <[email protected]>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
include <Metamaquina2.h>;
include <BillOfMaterials.h>;
include <washers.h>;
include <bolts.h>;
include <nuts.h>;
module t_slot_holes(width, thickness, joint_size=5){
translate([0, width/2])
circle(r=m3_diameter/2, $fn=20);
translate([0, width/4])
square([thickness, joint_size], center=true);
translate([0, 3*width/4])
square([thickness, joint_size], center=true);
}
module t_slot_cuts(width, diameter, length){
translate([0, width/2])
rotate([0, 0, 90])
t_slot_shape(diameter, length);
}
module t_slot_shape(diameter, length){
{
//TODO: Add these nuts, washers and bolts to the CAD model
BillOfMaterials(str("M",diameter,"x",length," bolt"), ref=str("H_M",diameter,"x",length));
BillOfMaterials(str("M",diameter," nut"), ref=str("P_M",diameter));
BillOfMaterials(str("M",diameter," washer"), ref=str("AL_M",diameter));
}
translate([-diameter/2, 0])
square([diameter, length]);
translate([-diameter, length-(3/2)*diameter])
square([2*diameter, diameter]);
}
module t_slot_joints(width, thickness, joint_size=5){
translate([0, width/4])
square([thickness, joint_size], center=true);
translate([0, 3*width/4])
square([thickness, joint_size], center=true);
}
module t_slot_bolt_washer_nut(diameter, length){
washer_height = 0.5;
//bolt head
translate([0, 0, washer_height])
difference(){
cylinder(r=diameter, h=0.75 * diameter, $fn=20);
translate([0,0,0.25*diameter])
cylinder(r=diameter*0.7, h=diameter, $fn=6);
}
//washer
cylinder(r=diameter*1.4, h=washer_height, $fn=20);
//bolt body
translate([0, 0, -length + washer_height])
cylinder(r=diameter/2, h=length, $fn=20);
//nut
translate([0, 0, -length+diameter])
cylinder(r=diameter, h=diameter/2, $fn=6);
}
module tslot_shapes_from_list(list, length=16){
for (tslot=list){
assign(x=tslot[0],
y=tslot[1],
angle=tslot[2])
translate([x,y])
rotate(angle)
t_slot_shape(3,length);
}
}
module tslot_holes_from_list(list){
for (tslot=list){
assign(x=tslot[0],
y=tslot[1],
width=tslot[2],
angle=tslot[3])
if(width>0)
translate([x, y])
rotate(angle)
TSlot_holes(width=width);
}
}
//how is this different from t_slot_bolt_washer_nut() ?
module tslot_parts_from_list(list, length=16){
for (tslot=list){
assign(x=tslot[0],
y=tslot[1],
width=tslot[2],
angle=tslot[3])
translate([x, y])
rotate(angle)
translate([0, width/2]){
translate([0, 0, thickness]){
M3_washer();
translate([0,0,m3_washer_thickness])
bolt(3,length);
}
translate([0,0,8-length])
M3_nut();
}
}
}