diff options
| author | Franklin Wei <franklin@rockbox.org> | 2019-11-28 01:59:09 -0500 |
|---|---|---|
| committer | Franklin Wei <franklin@rockbox.org> | 2019-11-28 01:59:09 -0500 |
| commit | 990b2671e401f8f65038db06efbdc4ec0277c691 (patch) | |
| tree | a5e0a68307f8976317c40e7d8a652a0d146807c4 | |
| parent | 00c74d112d31f54cd72e07d2254dc93f4912b32f (diff) | |
| download | rastercarve-990b2671e401f8f65038db06efbdc4ec0277c691.zip rastercarve-990b2671e401f8f65038db06efbdc4ec0277c691.tar.gz rastercarve-990b2671e401f8f65038db06efbdc4ec0277c691.tar.bz2 rastercarve-990b2671e401f8f65038db06efbdc4ec0277c691.tar.xz | |
Add traverse back to start and flip Y direction.
| -rwxr-xr-x | src/rastercarve.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/rastercarve.py b/src/rastercarve.py index 76548ff..ac4fb1c 100755 --- a/src/rastercarve.py +++ b/src/rastercarve.py @@ -15,6 +15,7 @@ import sys FEEDRATE = 100 # in / min PLUNGE_RATE = 10 # in / min SAFE_Z = .2 # tool will start/end this high from material +TRAVERSE_Z = 1 MAX_DEPTH = .080 # full black is this many inches deep TOOL_ANGLE = 60 # included angle of tool (we assume a V-bit). change if needed @@ -63,11 +64,11 @@ def move(x, y, z, f = FEEDRATE): if is_firstmove: f = PLUNGE_RATE is_firstmove = False - print("G1 F%d X%f Y%f Z%f" % (f, x, y, z)) + print("G1 F%d X%f Y%f Z%f" % (f, x, -y, z)) updatePos(np.array([x, y, z])) def moveRapid(x, y, z): - print("G0 X%f Y%f Z%f" % (x, y, z)) + print("G0 X%f Y%f Z%f" % (x, -y, z)) updatePos(np.array([x, y, z])) def moveSlow(x, y, z): @@ -160,8 +161,8 @@ def doEngrave(img): end = engraveLine(img_interp, img_size, interp_ppi, start, -d) - moveSlow(end[0], end[1], SAFE_Z) - moveRapid(0, 0, SAFE_Z) + moveSlow(end[0], end[1], TRAVERSE_Z) + moveRapid(0, 0, TRAVERSE_Z) ### Dump stats eprint("=== Statistics ===") |