-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblot3.js
128 lines (97 loc) · 1.72 KB
/
blot3.js
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
// check out this guide to learn how to program in blot
// https://blot.hackclub.com/editor?guide=start
// store final lines here
const width = 147;
const height = 142;
setDocDimensions(width, height);
const beakLength = 10
const beakW = 2.8
const finalLines = [];
const bottomEdge = [
bt.nurbs([
[-2, -1],
[beakLength * 0.1, beakW],
[beakLength * 0.8, beakW * 0.85],
[beakLength, 2]
])
]
bt.translate(bottomEdge, [44.5, 88]);
const topEdge = [
bt.nurbs([
[-3, -1],
[beakLength * 0.5, 4],
[beakLength * 1.6, beakW * -1.89],
[beakLength, 0]
])
]
bt.translate(topEdge, [43, 94]);
bt.rotate(topEdge, 46);
const beak = bt.join(topEdge, bottomEdge);
bt.rotate(beak, 59);
// draw it
drawLines(beak);
const joint = [
bt.nurbs([
[-3, 2],
[6, 1],
[4, -2]
])
]
bt.translate(joint, [50, 98]);
bt.rotate(joint, -11);
drawLines(joint);
//BEAK DONE
//MOUTH
const mouthLine = [
bt.nurbs([
[29, 1],
[23, -2],
[19, -1]
])
]
bt.translate(mouthLine,[30.5,88]);
bt.rotate(mouthLine, -25);
drawLines(mouthLine);
//curve at the mouth
const mouthCurve = [
bt.nurbs([
[-3, -97],
[-7, -90],
[1, -87]
])
]
bt.translate(mouthCurve,[59.2,184]);
bt.rotate(mouthCurve, -129);
drawLines(mouthCurve);
// done mouth
// head
const headL = [
bt.nurbs([
[-1, -98],
[-1, -89],
[1, -92]
])
]
bt.translate(headL,[49.0,198]);
bt.rotate(headL, -6);
drawLines(headL);
const head2 = [
bt.nurbs([
[-3, -93],
[-1, -96],
[1, -92]
])
]
bt.translate(head2,[52.9,201]);
bt.rotate(head2, 202);
drawLines(head2);
const head = [
bt.nurbs([
[-23, -89],
[-19, -94],
[2, -88]
])
]
bt.translate(head,[76.6,196]);
bt.rotate(head, 161);
drawLines(head);