-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathmotorMountPlate.groovy
62 lines (54 loc) · 2.02 KB
/
motorMountPlate.groovy
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
LengthParameter printerOffset = new LengthParameter("printerOffset",0.5,[2,0.001])
printerOffset.setMM(0.6)
motor=(CSG)ScriptingEngine
.gitScriptRun(
"https://github.com/WPIRoboticsEngineering/RBELabCustomParts.git", // git location of the library
"gb37y3530-50en.groovy" , // file to load
null
)
.movez(-5.8)
CSG vshaft = (CSG)ScriptingEngine
.gitScriptRun(
"https://github.com/WPIRoboticsEngineering/RBELabCustomParts.git", // git location of the library
"vexShaft.groovy" , // file to load
[60]
)
double vexHoleSpacing = 0.5*25.4
double vexSquare = 0.182
CSG gear =Vitamins.get("vexGear","HS36T")
.difference(motor)
.roty(180)
.toZMin()
CSG mesh = Vitamins.get("vexGear","HS12T")
.difference(vshaft)
int gearRadiusIndex = (int)((gear.getMaxX()+mesh.getMaxX())/vexHoleSpacing)
println gearRadiusIndex
mesh=mesh.movex(vexHoleSpacing*gearRadiusIndex)
CSG spacer = Vitamins.get("vexSpacer","oneEighth")
.toZMax()
.movex(vexHoleSpacing*gearRadiusIndex)
HashMap<String,Object> vexSpacerConfig = Vitamins.getConfiguration( "vexSpacer","oneEighth")
double innerRadius = vexSpacerConfig.innerDiameter/2
CSG vexHole = new Cylinder(innerRadius, innerRadius, vexHoleSpacing*2, 10).toCSG()
.toZMax()
CSG vexHoleSet = vexHole
int width = 4
int length = 2
for(int i=0;i<length;i++){
for(int j=-(width/2);j<(width/2+1);j++){
vexHoleSet=vexHoleSet.union(vexHole
.movex((i*vexHoleSpacing)+vexHoleSpacing)
.movey(j*vexHoleSpacing)
)
}
}
CSG mountPlate = new Cube(vexHoleSpacing*(length+2.5),vexHoleSpacing*(width+1),vexHoleSpacing/2).toCSG()
.toZMax()
.toXMin()
.movex(-vexHoleSpacing*2)
.difference([motor,vexHoleSet])
mountPlate.setMfg( {toMfg ->
toMfg.rotx(180)
.toZMin()
})
return [motor,gear,mesh,spacer,mountPlate]