-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbookcase
More file actions
42 lines (32 loc) · 1.16 KB
/
bookcase
File metadata and controls
42 lines (32 loc) · 1.16 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 geometry2d
def origin as Vector = Vector(0 0)
def thickness = 12
def w = 750
def h = 750
def d = 320
def cornerTab (sV as Vector eV as Vector) = {
line(sV eV)
}
#side 1
rectangle(origin.x origin.y origin.x + thickness origin.y + h)
#side 2
rectangle(origin.x + w origin.y origin.x + 750 - thickness origin.y + h)
#bottom
rectangle(origin.x + thickness origin.y origin.x + w - thickness origin.y + thickness)
#top
rectangle(origin.x + thickness origin.y + h origin.x + w - thickness origin.y + h - thickness)
#middle
rectangle(((origin.x + w / 2) - thickness / 2) origin.y + thickness ((origin.x + thickness / 2) + w / 2) origin.y + h - thickness)
#PARTS FOR CUTTING
def makeSide(offs as Vector c1 as Vector c2 as Vector) = {
def x1 = c1.x + offs.x
def y1 = c1.y + offs.y
line(c1.x + offs.x c1.y + offs.y c1.x + offs.x c2.y + offs.y)
line(c1.x + offs.x + d c1.y + offs.y c1.x + offs.x + d c2.y + offs.y)
cornerTab(Vector(x1 c1.y) Vector(x1 + d c1.y))
cornerTab(Vector(x1 c2.y) Vector(x1 + d c2.y))
}
def vS1 = Vector(origin.x origin.y)
def vS2 = Vector(origin.x + d origin.y + h)
def offset = Vector(1100 0) #olacement of the part
makeSide(offset vS1 vS2)