-
Notifications
You must be signed in to change notification settings - Fork 0
/
router-template-slate.kcl
87 lines (79 loc) · 2.34 KB
/
router-template-slate.kcl
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
// Router template for a slate
// A guide for routing a slate for a cross bar.
// Define constants
routerDiameter = 12.7
mmInInch = 25.4
templateDiameter = mmInInch * 11 / 16
templateGap = (templateDiameter - routerDiameter) / 2 - 0.5
slateWidthHalf = 41.5 / 2
minClampingDistance = 50 + 30
templateThickness = 10
radius = 10
depth = 30
length001 = slateWidthHalf - radius
length002 = depth + minClampingDistance
// Create the first sketch
sketch001 = startSketchOn('XZ')
|> startProfileAt([0, depth - templateGap], %)
|> xLine(length001, %, $seg01)
|> arc({
angleEnd = 0,
angleStart = 90,
radius = radius - templateGap
}, %)
|> yLineTo(-templateGap * 2 - (templateDiameter / 2), %, $seg05)
|> xLineTo(slateWidthHalf + templateThickness, %, $seg04)
|> yLine(-length002, %, $seg03)
|> xLineTo(ZERO, %, $seg02)
// |> line([7.78, 11.16], %)
|> xLine(-segLen(seg02), %)
|> yLine(segLen(seg03), %)
|> xLine(segLen(seg04), %)
|> yLine(segLen(seg05), %)
|> arc({
angleEnd = 90,
angleStart = 180,
radius = radius - templateGap
}, %)
|> lineTo([profileStartX(%), profileStartY(%)], %)
|> close(%)
// Extrude the first sketch
extrude001 = extrude(5, sketch001)
// Create the second sketch
sketch002 = startSketchOn(extrude001, 'START')
|> startProfileAt([
-slateWidthHalf,
-templateGap * 2 - (templateDiameter / 2)
], %)
|> xLine(-7, %, $rectangleSegmentA001)
|> angledLine([
segAng(rectangleSegmentA001) + 90,
minClampingDistance
], %, $rectangleSegmentB001)
|> angledLine([
segAng(rectangleSegmentA001),
-segLen(rectangleSegmentA001)
], %, $rectangleSegmentC001)
|> lineTo([profileStartX(%), profileStartY(%)], %)
|> close(%)
// Extrude the second sketch
extrude002 = extrude(7.5, sketch002)
// Create the third sketch
sketch003 = startSketchOn(extrude001, 'START')
|> startProfileAt([
slateWidthHalf,
-templateGap * 2 - (templateDiameter / 2)
], %)
|> xLine(7, %, $rectangleSegmentA002)
|> angledLine([
segAng(rectangleSegmentA002) - 90,
minClampingDistance
], %)
|> angledLine([
segAng(rectangleSegmentA002),
-segLen(rectangleSegmentA002)
], %)
|> lineTo([profileStartX(%), profileStartY(%)], %)
|> close(%)
// Extrude the third Sketch
extrude003 = extrude(7.5, sketch003)