-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblotTutorial
95 lines (65 loc) · 1.49 KB
/
blotTutorial
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
// check out the workshop tab to get started
// welcome to blot!
// check out this guide to learn how to program in blot
// https://blot.hackclub.com/editor?guide=start
const width = 125;
const height = 125;
setDocDimensions(width, height);
drawLines([
[
[20,33],
[90, 90]//line
]
])
drawLines([
[
[22,31],
[94, 90]//line
]
])
const s = 50
drawLines([
[
[0, 0],
[0, s],
[s, s],
[s, 0],
[0, 0]
]
])
const shth = 3 // shaft thickness
const shl = 117 // shaft length
const cl = 30 // calamus length (part without vanes)
const vw = 20 // vane width, per vane
const t = new bt.Turtle()
// start pointing diagonally, and further within drawing area
t.left(39).jump([12, 26])
// draw the shaft
t.forward(shl).left(90).forward(shth).left(90)
t.forward(shl).left(90).forward(shth).left(90)
// move to start of vanes
t.up().forward(cl).left(90).forward(shth/2).right(90).down()
// draw vanes
const short = vw * Math.sqrt(2)
const long = shl - cl - 2 * vw
t.left(45)
t.forward(short).right(45).forward(long).right(45).forward(short)
.right(90)
t.forward(short).right(45).forward(long).right(45).forward(short)
drawLines(t.lines())
// store final lines here
const finalLines = [];
// create a polyline
const polyline = [
[30, 90],
[100, 90],
[100, 30],
[30, 30],
[30, 90]
];
// add the polyline to the final lines
//finalLines.push(polyline);
// transform lines using the toolkit
//bt.rotate(finalLines, 45);
// draw it
drawLines(finalLines);