-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstrumentpanel
More file actions
74 lines (61 loc) · 2.62 KB
/
instrumentpanel
File metadata and controls
74 lines (61 loc) · 2.62 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import aircraftInstruments
#design your own instrument panel for your aircraft!
#INPUT:
#width = widht of the panel
#verticalHeight = height of the vertical part of the sides
#curvedHeight = height of the panel top curve
def instrumentPanel(width as Number verticalHeight as Number curvedHeight as Number) = {
# --- START SCRIPT --- #
#bottom and sides:
def w = width / 2
def v = verticalHeight
line(-1 * w 0 w 0)
line(-1 * w 0 -1 * w v)
line(w 0 w v)
#top curve
def endX = w - 100
def stepX = endX / 10
def stepY = curvedHeight / 10
#leftCurve
line(((0 * stepX) - w) ((0 * stepY) + v) ((1 * stepX) - w) ((3 * stepY) + v))
line(((1 * stepX) - w) ((3 * stepY) + v) ((2 * stepX) - w) ((5 * stepY) + v))
line(((2 * stepX) - w) ((5 * stepY) + v) ((3 * stepX) - w) ((6.5 * stepY) + v))
line(((3 * stepX) - w) ((6.5 * stepY) + v) ((4 * stepX) - w) ((7.5 * stepY) + v))
line(((4 * stepX) - w) ((7.5 * stepY) + v) ((5 * stepX) - w) ((8.2 * stepY) + v))
line(((5 * stepX) - w) ((8.2 * stepY) + v) ((6 * stepX) - w) ((8.8 * stepY) + v))
line(((6 * stepX) - w) ((8.8 * stepY) + v) ((7 * stepX) - w) ((9.3 * stepY) + v))
line(((7 * stepX) - w) ((9.3 * stepY) + v) ((8 * stepX) - w) ((9.7 * stepY) + v))
line(((8 * stepX) - w) ((9.7 * stepY) + v) ((9 * stepX) - w) ((9.9 * stepY) + v))
line(((9 * stepX) - w) ((9.9 * stepY) + v) ((10 * stepX) - w) ((10 * stepY) + v))
#middle line
line(-100 verticalHeight + curvedHeight 100 verticalHeight + curvedHeight)
#leftCurve
line(((0 * stepX) + w) ((0 * stepY) + v) ((-1 * stepX) + w) ((3 * stepY) + v))
line(((-1 * stepX) + w) ((3 * stepY) + v) ((-2 * stepX) + w) ((5 * stepY) + v))
line(((-2 * stepX) + w) ((5 * stepY) + v) ((-3 * stepX) + w) ((6.5 * stepY) + v))
line(((-3 * stepX) + w) ((6.5 * stepY) + v) ((-4 * stepX) + w) ((7.5 * stepY) + v))
line(((-4 * stepX) + w) ((7.5 * stepY) + v) ((-5 * stepX) + w) ((8.2 * stepY) + v))
line(((-5 * stepX) + w) ((8.2 * stepY) + v) ((-6 * stepX) + w) ((8.8 * stepY) + v))
line(((-6 * stepX) + w) ((8.8 * stepY) + v) ((-7 * stepX) + w) ((9.3 * stepY) + v))
line(((-7 * stepX) + w) ((9.3 * stepY) + v) ((-8 * stepX) + w) ((9.7 * stepY) + v))
line(((-8 * stepX) + w) ((9.7 * stepY) + v) ((-9 * stepX) + w) ((9.9 * stepY) + v))
line(((-9 * stepX) + w) ((9.9 * stepY) + v) ((-10 * stepX) + w) ((10 * stepY) + v))
}
#test
instrumentPanel(900 130 160)
#primary flight instruments
threeInchGauge(-355 140)
twoInchGauge(-355 50)
threeInchGauge(-250 175)
threeInchGauge(-250 70)
threeInchGauge(-140 175)
threeInchGauge(-140 70)
#engine instruments
twoInchGauge(-40 80)
twoInchGauge(-40 180)
twoInchGauge(40 80)
twoInchGauge(40 180)
repeat 0 to 8 using i {
def x = i * 20
circle(x - 70 22 3)
}