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:
sliptonic 2016-07-03 12:02:24 -05:00 committed by Yorik van Havre
parent d1b927767a
commit bf46ea4804
7 changed files with 19 additions and 42 deletions

View File

@ -18,6 +18,7 @@ SET(PathScripts_SRCS
PathScripts/PostUtils.py
PathScripts/example_pre.py
PathScripts/opensbp_pre.py
PathScripts/opensbp_post.py
PathScripts/example_post.py
PathScripts/linuxcnc_post.py
PathScripts/centroid_post.py

View File

@ -196,8 +196,7 @@ class _ViewProviderMachine:
pass
def setEdit(self, vobj, mode=0): # optional
# this is executed when the object is double-clicked in the tree
pass
return True
def unsetEdit(self, vobj, mode=0): # optional
# this is executed when the user cancels or terminates edit mode

View File

@ -289,7 +289,7 @@ print "y - " + str(point.y)
output += "(" + obj.Label + ")"
if obj.Side != "On":
output += "(Compensated Tool Path: " + str(self.radius) + ")"
output += "(Compensated Tool Path. Diameter: " + str(self.radius * 2) + ")"
else:
output += "(Uncompensated Tool Path)"

View File

@ -282,7 +282,7 @@ class ObjectSurface:
obj.Label = obj.UserLabel + " :" + obj.ToolDescription
output += "(" + obj.Label + ")"
output += "(Compensated Tool Path: " + str(self.radius) + ")"
output += "(Compensated Tool Path. Diameter: " + str(self.radius * 2) + ")"
if obj.Base:
for b in obj.Base:

View File

@ -1,31 +0,0 @@
import math
class depth_params:
def __init__(self, clearance_height, rapid_safety_space, start_depth, step_down, z_finish_depth, z_thru_depth, final_depth, user_depths):
self.clearance_height = clearance_height
self.rapid_safety_space = math.fabs(rapid_safety_space)
self.start_depth = start_depth
self.step_down = math.fabs(step_down)
self.z_finish_depth = math.fabs(z_finish_depth)
self.z_thru_depth = math.fabs(z_thru_depth)
self.final_depth = final_depth
self.user_depths = user_depths
def get_depths(self):
if self.user_depths != None:
depths = self.user_depths
else:
depth = self.final_depth - self.z_thru_depth
depths = [depth]
depth += self.z_finish_depth
if depth + 0.0000001 < self.start_depth:
if self.z_finish_depth > 0.0000001: depths.insert(0, depth)
depth += self.z_thru_depth
layer_count = int((self.start_depth - depth) / self.step_down - 0.0000001) + 1
if layer_count > 0:
layer_depth = (self.start_depth - depth)/layer_count
for i in range(1, layer_count):
depth += layer_depth
depths.insert(0, depth)
return depths

View File

@ -49,7 +49,7 @@ LINENR = 100 # line number starting value
# These globals will be reflected in the Machine configuration of the project
UNITS = "G21" # G21 for metric, G20 for us standard
MACHINE_NAME = "Millstone"
MACHINE_NAME = "LinuxCNC"
CORNER_MIN = {'x': 0, 'y': 0, 'z': 0}
CORNER_MAX = {'x': 500, 'y': 300, 'z': 300}

View File

@ -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)