-
Notifications
You must be signed in to change notification settings - Fork 4
/
chainmaker.scad
101 lines (79 loc) · 3.03 KB
/
chainmaker.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
//cam options
makeBoundsForToothCutPocket = "false";
doProjectionFor2dCam = "false";
//general chainring options
numberOfTeeth = 39;
numberOfBolts = 5;
bcd = 110; //bolt circle diameter
boltHoleDiameter = 10.2; //10mm seems standard (a bit bigger to be safe)
internalDiameterOffsetFromHoles = 2.75; //seems typical
ringThickness = 2.5; //seems about right (and is 7075 stock I have..)
toothThickness = 2.1; //should be OK for 8/9 speed - want thinner for 10
toothThinningRadiusInset = 9;
pocketBoundsWidth = 3;
//tooth options
widthPerCog = 12.7; //.5 inch in mm
rollerDiameter = 7.6;
cutDepth = 5.1;
rollerCenterInsetFromExternalDiameter = cutDepth - (rollerDiameter / 2);
roundingDiameter = cutDepth * 5.6;
roundingOffset = cutDepth * 2.48;
toothAspectRatio = .9;
pi = 3.1415;
//openscad resolution
$fa = 4;
$fs = 1;
externalDiameter = ((numberOfTeeth * widthPerCog) / pi) + rollerCenterInsetFromExternalDiameter * 2;
innerDiameter = (bcd - boltHoleDiameter) - internalDiameterOffsetFromHoles;
translate ([(externalDiameter / 2), (externalDiameter / 2), -1]) {
if (doProjectionFor2dCam == "true") {
projection() makeChainRing();
} else {
makeChainRing();
}
}
module makeChainRing() {
difference() {
cylinder (ringThickness, externalDiameter / 2, externalDiameter / 2);
for (tooth = [0 : numberOfTeeth]) {
rotate ([0, 0, (360 / numberOfTeeth) * tooth])
translate ([externalDiameter / 2, 0, -.1])
tooth();
}
for (bolt = [0 : numberOfBolts]) {
rotate ([0, 0, (360 / numberOfBolts) * bolt])
translate ([bcd / 2, 0, -.1])
cylinder (ringThickness * 2, boltHoleDiameter / 2, boltHoleDiameter / 2);
}
//inner cut
translate ([0, 0, -.1])
cylinder (ringThickness * 2,innerDiameter / 2,innerDiameter / 2);
//thin teeth
translate ([0, 0, toothThickness])
teethThin();
if (makeBoundsForToothCutPocket == "true") boundsForToothCutPocket();
}
}
module teethThin() {
difference() {
cylinder (ringThickness, (externalDiameter / 2) + 1, (externalDiameter / 2) + 1);
translate ([0, 0, -.1])
cylinder (ringThickness + 1, (externalDiameter / 2) - toothThinningRadiusInset,
(externalDiameter / 2) - toothThinningRadiusInset);
}
}
module boundsForToothCutPocket() {
translate ([0, 0, -.1])
difference() {
cylinder (ringThickness + 1, (externalDiameter / 2) - toothThinningRadiusInset,
(externalDiameter / 2) - toothThinningRadiusInset);
cylinder (ringThickness + 1, (externalDiameter / 2) - (toothThinningRadiusInset + pocketBoundsWidth),
(externalDiameter / 2) - (toothThinningRadiusInset + pocketBoundsWidth));
}
}
module tooth(){
scale ([1,toothAspectRatio,1])
cylinder (ringThickness * 2, cutDepth, cutDepth);
translate ([roundingOffset, 0, 0])
cylinder (ringThickness * 2, roundingDiameter / 2, roundingDiameter / 2);
}