-
Notifications
You must be signed in to change notification settings - Fork 13
/
005_path.go
64 lines (53 loc) · 927 Bytes
/
005_path.go
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
package main
import (
"github.com/buchanae/ink/color"
"github.com/buchanae/ink/dd"
. "github.com/buchanae/ink/dd"
"github.com/buchanae/ink/gfx"
)
func Ink(doc gfx.Doc) {
pen := &Pen{}
pen.MoveTo(XY{0.1, 0.4})
pen.Line(XY{0.1, 0.2})
pen.Line(XY{0.1, -0.2})
pen.Line(XY{-0.25, 0.125})
pen.Line(XY{0.3, 0.0})
pen.Close()
pen.MoveTo(XY{0.7, 0.5})
pen.QuadraticTo(XY{0.9, 0.6}, XY{0.7, 0.6})
pen.QuadraticTo(XY{0.8, 0.5}, XY{0.9, 0.5})
pen.Close()
shapes := []dd.Strokeable{
pen,
Rect{
XY{0.1, 0.7},
XY{0.3, 0.9},
},
Circle{
XY: XY{0.5, 0.5},
Radius: 0.1,
},
Triangle{
XY{.7, .1},
XY{.8, .3},
XY{.9, .1},
},
Ellipse{
XY: XY{.2, .2},
Size: XY{.15, .1},
},
Quad{
XY{0.65, 0.7},
XY{0.9, 0.7},
XY{0.85, 0.95},
XY{0.7, 0.9},
},
}
for _, s := range shapes {
gfx.Stroke{
Shape: s,
Color: color.Red,
Width: 0.002,
}.Draw(doc)
}
}