diff options
author | N.N. <matju@users.sourceforge.net> | 2009-11-06 18:37:00 +0000 |
---|---|---|
committer | N.N. <matju@users.sourceforge.net> | 2009-11-06 18:37:00 +0000 |
commit | 5a6bee4fe076e06514c6e4e538590dd3a2a5cdc3 (patch) | |
tree | ecf543b363457a0c861bfb187080a45fdeffc349 /externals/gridflow/bin/hpgl_move | |
parent | 5e6bb4f4786dd39158ffe02913590cc3dea21ebd (diff) |
upgrade gridflow
svn path=/trunk/; revision=12728
Diffstat (limited to 'externals/gridflow/bin/hpgl_move')
-rwxr-xr-x | externals/gridflow/bin/hpgl_move | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/externals/gridflow/bin/hpgl_move b/externals/gridflow/bin/hpgl_move new file mode 100755 index 00000000..f4bf0534 --- /dev/null +++ b/externals/gridflow/bin/hpgl_move @@ -0,0 +1,19 @@ +#!/usr/bin/env ruby +# Copyright (c) 2009 by Mathieu Bouchard + +x = Float ARGV[0] +y = Float ARGV[1] + +puts STDIN.read.split(/\s*;\s*/).map {|m| + h = m.slice!(0,2) + d = m.split(",") + case h + when "PA","PD","PU" + (0...d.length).each {|i| + off = if i%2==0 then x else y end + v = Float(d[i])+off + d[i] = if v==v.to_i then v.to_i else v.to_f end + } + end + h+d.join(",") +}.join(";") |