aboutsummaryrefslogtreecommitdiff
path: root/units.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-09-24 00:03:29 +0200
committerDimitri Sokolyuk <demon@dim13.org>2016-09-24 00:03:29 +0200
commit16415e31ff390fe106017e3e7fc5c692674bdcbf (patch)
tree67e7891e30167553492550bd8522dd3e58d7eb2f /units.go
parentc231f3cce3b20ed1b6a43d631ae2a779d15d78b7 (diff)
Path stringer
Diffstat (limited to 'units.go')
-rw-r--r--units.go13
1 files changed, 12 insertions, 1 deletions
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, ",")
+}