-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSimpleTray.groovy
More file actions
42 lines (38 loc) · 1.04 KB
/
SimpleTray.groovy
File metadata and controls
42 lines (38 loc) · 1.04 KB
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
import eu.mihosoft.vrl.v3d.CSG
import eu.mihosoft.vrl.v3d.Cube
import eu.mihosoft.vrl.v3d.Isosceles
double kerf = 5
double length = 200
double width = 50
double holeDiam = 3
double thickness = 5
CSG core = new Cube(length+kerf*2,width,thickness).toCSG()
CSG side = new Cube(length,width+kerf,thickness).toCSG()
.toYMax()
.movey(-width/2)
CSG side2 = new Cube(length,width+kerf,thickness).toCSG()
.toYMin()
.movey(width/2)
CSG end = new Cube(width,width*3+kerf*2,thickness).toCSG()
.toXMin()
.movex(length/2+kerf)
CSG otherEnd = end .toXMax()
.movex(-length/2-kerf)
CSG flap = new Isosceles(thickness,length,width).toCSG()
.roty(90)
.toZMin()
.rotz(90)
.movey(width/2+width*2+kerf)
.movez(-thickness/2)
core=core.union(side)
core=core.union(side2)
core=core.union(end)
core=core.union(otherEnd)
CSG covering = core
.union(side2.movey(width))
.union(flap)
.movey(width*3+kerf*3)
//core=core.toXMin().toYMin()
core.addExportFormat("svg")
covering.addExportFormat("svg")
return [core,covering]