OffsetXYZ will offset all X, Y and Z G-Code values by the specified values.
(f *File, x, y, z float64)
| 34 | |
| 35 | // OffsetXYZ will offset all X, Y and Z G-Code values by the specified values. |
| 36 | func OffsetXYZ(f *File, x, y, z float64) { |
| 37 | for _, l := range f.Lines { |
| 38 | for i, c := range l.Codes { |
| 39 | if c.Letter == "X" { |
| 40 | c.Value += x |
| 41 | } else if c.Letter == "Y" { |
| 42 | c.Value += y |
| 43 | } else if c.Letter == "Z" { |
| 44 | c.Value += z |
| 45 | } |
| 46 | |
| 47 | // update code |
| 48 | l.Codes[i] = c |
| 49 | } |
| 50 | } |
| 51 | } |
no outgoing calls