-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathruler
More file actions
39 lines (33 loc) · 791 Bytes
/
ruler
File metadata and controls
39 lines (33 loc) · 791 Bytes
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
#a paper ruler in CM
import font
import geometry2d
#CHANGE THE LENGTH IN MILLIMETERS OF THE RULER HERE:
def length = 100
#### - start script - ####
def un = 1 # mm
def start = -100
repeat start to start + length using inc {
if(un < 2) {
def jc = inc / un
line(jc 0 jc 4)
}
}
#5 MM MARKS
repeat (2 * start) / 10 to (((2 * start) / 10) + length / 5) + 1 using inc {
def ja = inc / un
def aa = ja * 5
line(aa 0 aa 6)
}
#10 MM MARKS
repeat start / 10 to (length / 10) + (start / 10) + 1 using inc {
def jnc = inc / un
def aa = jnc * 10
def cm1 = aa / 10
def cm = cm1 * un
line(aa * un 6 aa * un 8)
def t1 = aa - 1
def t2 = cm + 10
text(t1 * un 9 5 t2 / un) # NUMBERS
}
#BORDER
rectangle(start - 10 0 length + start + 10 20)