-
Notifications
You must be signed in to change notification settings - Fork 12
/
knob.go
39 lines (36 loc) · 928 Bytes
/
knob.go
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
package main
import (
"github.com/unixpickle/model3d/model3d"
"github.com/unixpickle/model3d/toolbox3d"
)
func CreateKnob() model3d.Solid {
return model3d.StackedSolid{
&model3d.Cylinder{
P2: model3d.Z(KnobBaseLength),
Radius: KnobBaseRadius,
},
&model3d.Cylinder{
P2: model3d.Z(KnobPoleLength),
Radius: KnobPoleRadius,
},
&toolbox3d.ScrewSolid{
P2: model3d.Coord3D{Z: DrawerThickness + KnobNutThickness},
GrooveSize: KnobScrewGroove,
Radius: KnobScrewRadius,
},
}
}
func CreateKnobNut() model3d.Solid {
return &model3d.SubtractedSolid{
Positive: &model3d.Cylinder{
P2: model3d.Z(KnobNutThickness),
Radius: KnobNutRadius,
},
Negative: &toolbox3d.ScrewSolid{
P1: model3d.Coord3D{Z: -1e-5},
P2: model3d.Coord3D{Z: KnobNutThickness + 1e-5},
GrooveSize: KnobScrewGroove,
Radius: KnobScrewRadius + KnobScrewSlack,
},
}
}