-
Notifications
You must be signed in to change notification settings - Fork 15
/
CameraMount.groovy
31 lines (29 loc) · 1005 Bytes
/
CameraMount.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
import com.neuronrobotics.sdk.addons.kinematics.math.RotationNR
import com.neuronrobotics.sdk.addons.kinematics.math.TransformNR
import eu.mihosoft.vrl.v3d.CSG
import eu.mihosoft.vrl.v3d.Cube
import eu.mihosoft.vrl.v3d.Cylinder
import com.neuronrobotics.bowlerstudio.physics.TransformFactory
//Your code here
if (args==null) {
args=[
120+(25.4*1.5), //Camera Height
5, //Camera Insert Length
5, //Camera Insert Diameter
25 //Grid
]
}
double grid=args[3]
double cameraInsertDia=args[2]
double cameraInsertLength=args[1]
double cameraHeight=args[0]
double xOffset=0
double yOffset=0
def cameraNut = new TransformNR(xOffset+grid/2,yOffset+grid/2,0,new RotationNR(0,0,0))
CSG cameraBoltHole = new Cylinder(2.5,cameraInsertLength+cameraHeight+2).toCSG()
CSG cameraCone = new Cylinder(grid/2, // Radius at the bottom
cameraInsertDia/2+2, // Radius at the top
cameraHeight, // Height
(int)8 //resolution
).toCSG()//convert to CSG to display
.transformed(TransformFactory.nrToCSG(cameraNut))