aboutsummaryrefslogtreecommitdiff
path: root/testpattern.go
blob: e9fb23557635da716502e45274d1f42b4d855ce0 (plain)
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
package robo

import "bufio"

func TestPattern(c *bufio.Writer) {
	Triple{100, 100, 100}.Factor(c)
	Point{0, 0}.Offset(c)
	Point{0, 0}.LowerLeft(c)
	Point{510, 637}.Move(c)
	Path{
		Point{510, 637}, Point{439, 637},
		Point{383, 580}, Point{383, 510},
	}.Bezier(c, 1)
	Path{
		Point{383, 510}, Point{383, 439},
		Point{439, 383}, Point{510, 383},
	}.Bezier(c, 1)
	Path{
		Point{510, 383}, Point{580, 383},
		Point{637, 439}, Point{637, 510},
	}.Bezier(c, 1)
	Path{
		Point{637, 510}, Point{637, 580},
		Point{580, 637}, Point{510, 637},
	}.Bezier(c, 1)
	Path{
		Point{764, 764}, Point{256, 764},
		Point{256, 256}, Point{764, 256},
		Point{764, 764},
	}.Line(c)
	Path{
		Point{2, 510}, Point{1018, 510},
	}.Line(c)
	Path{
		Point{510, 1018}, Point{510, 2},
	}.Line(c)
	Point{0, 0}.Move(c)
}

func (r Robo) TestPattern() {
	r.Factor(100, 100, 100)
	r.Offset(Point{0, 0})
	r.LowerLeft(Point{0, 0})
	r.Move(Point{510, 637})
	r.Bezier(Point{510, 637}, Point{439, 637}, Point{383, 580}, Point{383, 510})
	r.Bezier(Point{383, 510}, Point{383, 439}, Point{439, 383}, Point{510, 383})
	r.Bezier(Point{510, 383}, Point{580, 383}, Point{637, 439}, Point{637, 510})
	r.Bezier(Point{637, 510}, Point{637, 580}, Point{580, 637}, Point{510, 637})
	r.Line(Point{764, 764}, Point{256, 764}, Point{256, 256}, Point{764, 256}, Point{764, 764})
	r.Line(Point{2, 510}, Point{1018, 510})
	r.Line(Point{510, 1018}, Point{510, 2})
	r.Move(Point{0, 0})
}