aboutsummaryrefslogtreecommitdiff
path: root/cutter.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-05-02 23:57:37 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-05-02 23:57:37 +0200
commitf07b0c28f6c4c49b742b1dfb315f7fc755edb223 (patch)
tree23c45bb646c29e4b8270d5a1b9b3f7ae96f50495 /cutter.go
parent6c6dc92c24fa2aa120c1d85cecf5e97ccefbb96a (diff)
Add ellipse
Diffstat (limited to 'cutter.go')
-rw-r--r--cutter.go20
1 files changed, 19 insertions, 1 deletions
diff --git a/cutter.go b/cutter.go
index 2e087a4..d02e3f0 100644
--- a/cutter.go
+++ b/cutter.go
@@ -92,9 +92,13 @@ const (
ESC = 0x1b
)
-func (c Cutter) Send(a ...interface{}) {
+func (c Cutter) Add(a ...interface{}) {
fmt.Fprint(c, a...)
c.WriteByte(ETX)
+}
+
+func (c Cutter) Send(a ...interface{}) {
+ c.Add(a...)
c.Flush()
}
@@ -367,3 +371,17 @@ func (c Cutter) Circle(p Point, start, end Polar) {
start.R, ",", end.R, ",",
start.Theta, ",", end.Theta)
}
+
+// Not supported?
+func (c Cutter) Curve(a int, ph Path) {
+ c.Add("Y", a)
+ for _, p := range ph {
+ c.Add(",", p)
+ }
+ c.Flush()
+}
+
+func (c Cutter) Ellipse(a int, p Point, start, end Polar, theta int) {
+ c.Send(")", a, ",", p, ",", start.R, ",", end.R, ",",
+ start.Theta, ",", end.Theta, ",", theta)
+}