-
Notifications
You must be signed in to change notification settings - Fork 0
/
sablona_frezka.scad
executable file
·92 lines (79 loc) · 2.43 KB
/
sablona_frezka.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
echo(version=version());
$fn=50;
/** USER-DEFINED PARAMETERS **/
di = 8; // diameter of the pin for the inner milling
do = 12; // diameter of the pin for the outer milling
D = 10; // tool diameter
aD = 2; // width of the knob will be D+aD
l = 50; // length of the knob
h = 20; // height of the milling template
hf = 4; // height of the inner floor
ds = 4.5; // diameter of the screw hole
ls = 30; // distance of the screw holes
/** CALCULATED PARAMETERS **/
ri = di/2; // internal milling pin radius
ro = do/2; // external milling pin radius
R = D/2; // tool radius
w = D + aD; // width of the knob
wi = 2*w - 2*D + di; // width of the inner guide
li = 2*l - 2*D + di; // length of the inner guide
wo = 2*w + 2*D - do; // width of the outer guide
lo = 2*l + 2*D - do; // length of the outer guide
/** MODULES **/
module inner_guide()
{
offset(r=ri) offset(r=-ri) // outer fillet
offset(r=-ro) offset(r = -D+ri) // inner fillet
union() // the two rectangles, creating the basis of the inner guide
{
square([2*w+do, 2*l+do], center = true);
rotate(90) square([2*w+do, 2*l+do], center = true);
};
}
module outer_guide()
{
offset(r=ro) offset(r = +D-ro) // inner and outer fillet
union() // the two rectangles, creating the basis of the inner guide
{
square([2*w-do, 2*l-do], center = true);
rotate(90) square([2*w-do, 2*l-do], center = true);
};
}
module screw_hole()
{
union()
{
translate([0, 0, -h-2.5])
cylinder(h=h, d=ds, center=false);
translate([0, 0, -2.5])
cylinder(h=2.5, d1=ds, d2=9, center=false);
cylinder(h=h, d=9, center=false);
};
}
/** THE OBJECT **/
difference()
{
// inner and outer guide
difference()
{
linear_extrude(height = h, scale = 0.9) scale([1/0.9, 1/0.9, 1/0.9]) outer_guide();
translate([0, 0, hf])
linear_extrude(height = h, scale = 0.9) scale([1/0.9, 1/0.9, 1/0.9]) inner_guide();
// offset(r=-R+ro/2) scale([0.5,0.5]) outer_guide();
// offset(r=+R-ri/2) scale([0.5,0.5]) inner_guide();
};
// holes for screws
translate([0, 0, hf])
union()
{
screw_hole();
translate([ls, 0, 0])
screw_hole();
translate([0, ls, 0])
screw_hole();
translate([-ls, 0, 0])
screw_hole();
translate([0, -ls, 0])
screw_hole();
};
};