Additional fixes for post processing.
comment diameter instead of radius for compensated profile/surface ops opensbp improved pre processor is more explicit with XY values cmake copies opensbp postprocessor. Removed unnecessary file.
This commit is contained in:
committed by
Yorik van Havre
parent
d1b927767a
commit
bf46ea4804
@@ -46,13 +46,12 @@ TODO
|
||||
Many other OpenSBP commands not handled
|
||||
|
||||
'''
|
||||
import FreeCAD
|
||||
import os, Path
|
||||
|
||||
AXIS = 'X','Y','Z','A','B' #OpenSBP always puts multiaxis move parameters in this order
|
||||
SPEEDS = 'XY','Z','A','B'
|
||||
|
||||
import FreeCAD
|
||||
import os, Path
|
||||
|
||||
# to distinguish python built-in open function from the one declared below
|
||||
if open.__module__ == '__builtin__':
|
||||
pythonopen = open
|
||||
@@ -93,7 +92,7 @@ def parse(inputstring):
|
||||
movecommand = ['G1', 'G0', 'G02', 'G03']
|
||||
|
||||
for l in lines:
|
||||
print l
|
||||
# print l
|
||||
# remove any leftover trailing and preceding spaces
|
||||
l = l.strip()
|
||||
if not l:
|
||||
@@ -115,7 +114,8 @@ def parse(inputstring):
|
||||
s = "G0 "
|
||||
else: #feed move
|
||||
s = "G1 "
|
||||
speed = lastfeedspeed["XY"]
|
||||
speed = lastfeedspeed["XY"]
|
||||
|
||||
for i in range (1, len(words)):
|
||||
if words [i] == '':
|
||||
if last[AXIS[i-1]] == None:
|
||||
@@ -144,7 +144,10 @@ def parse(inputstring):
|
||||
|
||||
|
||||
last[words[0][1]] = words[1]
|
||||
output += s + words[0][1] + str(words[1]) + " F" + speed + "\n"
|
||||
output += s
|
||||
for key, val in last.iteritems():
|
||||
if val is not None:
|
||||
output += key + str(val) + " F" + speed + "\n"
|
||||
|
||||
if words[0] in ["JS"]: #set jog speed
|
||||
for i in range (1, len(words)):
|
||||
@@ -187,9 +190,14 @@ def parse(inputstring):
|
||||
s = "G2"
|
||||
else: #CCW
|
||||
s = "G3"
|
||||
|
||||
|
||||
s += " X" + words[2] + " Y" + words[3] + " I" + words[4] + " J" + words[5] + " F" + str(lastfeedspeed["XY"])
|
||||
output += s + '\n'
|
||||
|
||||
last["X"] = words[2]
|
||||
last["Y"] = words[3]
|
||||
|
||||
#Make sure all appended paths have at least one move command.
|
||||
if any (x in output for x in movecommand):
|
||||
return_output.append(output)
|
||||
|
||||
Reference in New Issue
Block a user