-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgeom.js
More file actions
41 lines (31 loc) · 712 Bytes
/
geom.js
File metadata and controls
41 lines (31 loc) · 712 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
40
41
// canvas margin
let margin = 24
// scale
let s = 14
// model width/height
let [w,h] = [70,20]
// canvas scaled width/height
let [cw,ch] = [s*w,s*h]
// plateu heigth
let ph = 3
// crane
let qh = 16 // half crane height
let qw = 40 // half crane width
// stacks of discs
let dw = 32 // half disc width
let dh = 3 // half disc height
let sp = 17 // padding between stacks
let stacksLeft = margin // left margin of the stacks
let xi = i => i * (dw*2 + sp)
let hi = i => (i * (dh*2 + 1))
let stackX = i => stacksLeft + margin + xi(i)
let stackY = j => ch - hi(j) - margin
module.exports = {
margin, s,
w, h, cw, ch,
ph,
qh, qw,
dw, dh, sp, stacksLeft,
xi, hi,
stackY, stackX
}