From 16415e31ff390fe106017e3e7fc5c692674bdcbf Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sat, 24 Sep 2016 00:03:29 +0200 Subject: Path stringer --- units.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'units.go') diff --git a/units.go b/units.go index 93c0756..7939c65 100644 --- a/units.go +++ b/units.go @@ -1,6 +1,9 @@ package robo -import "fmt" +import ( + "fmt" + "strings" +) const ( MM = Unit(20.0) @@ -63,3 +66,11 @@ func parseTriple(s string) (t Triple) { } type Path []Point + +func (p Path) String() string { + pp := make([]string, len(p)) + for i, pt := range p { + pp[i] = pt.String() + } + return strings.Join(pp, ",") +} -- cgit v1.2.3