Drilling handles multiple locations

Jog rates started
Automatically create default tool in new job.
This commit is contained in:
sliptonic
2016-08-16 08:53:33 -05:00
committed by Yorik van Havre
parent e790963a45
commit 2f04ea9586
20 changed files with 1941 additions and 224 deletions

View File

@@ -61,15 +61,11 @@ class ObjectProfile:
obj.addProperty("App::PropertyEnumeration", "Algorithm", "Algorithm", QtCore.QT_TRANSLATE_NOOP("App::Property","The library or algorithm used to generate the path"))
obj.Algorithm = ['OCC Native', 'libarea']
obj.addProperty("App::PropertyLink", "ActiveTC", "Tool", QtCore.QT_TRANSLATE_NOOP("App::Property","The tool controler in use"))
obj.addProperty("App::PropertyEnumeration", "ToolControllers", QtCore.QT_TRANSLATE_NOOP("App::Property","The tool controller to use"))
obj.Toolcontrollers = []
# obj.addProperty("App::PropertyIntegerConstraint", "ToolNumber", "Tool", "The tool number in use")
# obj.ToolNumber = (0, 0, 1000, 1)
# obj.setEditorMode('ToolNumber', 1) # make this read only
# obj.addProperty("App::PropertyString", "ToolDescription", "Tool", "The description of the tool ")
# obj.setEditorMode('ToolDescription', 1) # make this read onlyt
obj.addProperty("App::PropertyIntegerConstraint", "ToolNumber", "Tool", "The tool number in use")
obj.ToolNumber = (0, 0, 1000, 1)
obj.setEditorMode('ToolNumber', 1) # make this read only
obj.addProperty("App::PropertyString", "ToolDescription", "Tool", "The description of the tool ")
obj.setEditorMode('ToolDescription', 1) # make this read onlyt
# Depth Properties
obj.addProperty("App::PropertyDistance", "ClearanceHeight", "Depth", QtCore.QT_TRANSLATE_NOOP("App::Property","The height needed to clear clamps and obstructions"))
@@ -117,7 +113,7 @@ class ObjectProfile:
obj.angles = angles
obj.lengths = lengths
obj.heights = heights
obj.ToolDescription = "UNDEFINED"
#obj.ToolDescription = "UNDEFINED"
obj.Proxy = self
@@ -188,7 +184,8 @@ class ObjectProfile:
wire, obj.Side, self.radius, clockwise,
obj.ClearanceHeight.Value, obj.StepDown, obj.StartDepth.Value,
obj.FinalDepth.Value, FirstEdge, PathClosed, obj.SegLen.Value,
self.vertFeed, self.horizFeed, PlungeAngle=obj.PlungeAngle.Value)
self.vertFeed, self.horizFeed, self.vertRapid, self.horizRapid,
PlungeAngle=obj.PlungeAngle.Value)
return output
@@ -214,7 +211,7 @@ class ObjectProfile:
PathKurveUtils.feedrate_hv(self.horizFeed, self.vertFeed)
output = ""
output += "G0 Z" + str(obj.ClearanceHeight.Value)
output += "G0 Z" + str(obj.ClearanceHeight.Value) + "F " + PathUtils.fmt(self.vertRapid) + "\n"
curve = PathKurveUtils.makeAreaCurve(edgelist, obj.Direction, startpoint, endpoint)
'''The following line uses a profile function written for use with FreeCAD. It's clean but incomplete. It doesn't handle
@@ -226,7 +223,8 @@ print "y - " + str(point.y)
or probably other features in heekscnc'''
# output += PathKurveUtils.profile(curve, side, radius, vf, hf, offset_extra, rapid_safety_space, clearance, start_depth, step_down, final_depth, use_CRC)
'''The following calls the original procedure from heekscnc profile function. This, in turn, calls many other procedures to modify the profile.
'''The following calls the original procedure from h
toolLoad = obj.activeTCeekscnc profile function. This, in turn, calls many other procedures to modify the profile.
This procedure is hacked together from heekscnc and has not been thoroughly reviewed or understood for FreeCAD. It can probably be
thoroughly optimized and improved but it'll take a smarter mind than mine to do it. -sliptonic Feb16'''
roll_radius = 2.0
@@ -255,10 +253,10 @@ print "y - " + str(point.y)
obj.FinalDepth.Value, None)
PathKurveUtils.profile2(
curve, obj.Side, self.radius, self.vertFeed,
self.horizFeed, obj.OffsetExtra.Value, roll_radius, None, None,
depthparams, extend_at_start, extend_at_end, lead_in_line_len,
lead_out_line_len)
curve, obj.Side, self.radius, self.vertFeed, self.horizFeed,
self.vertRapid, self.horizRapid, obj.OffsetExtra.Value, roll_radius,
None, None, depthparams, extend_at_start, extend_at_end,
lead_in_line_len, lead_out_line_len)
output += PathKurveUtils.retrieve_gcode()
return output
@@ -267,17 +265,23 @@ print "y - " + str(point.y)
import Part # math #DraftGeomUtils
output = ""
#toolLoad = PathUtils.getLastToolLoad(obj)
toolLoad = obj.activeTC
toolLoad = PathUtils.getLastToolLoad(obj)
# obj.ToolController = PathUtils.getToolControllers(obj)
# toolLoad = PathUtils.getToolLoad(obj, obj.ToolController)
if toolLoad is None or toolLoad.ToolNumber == 0:
self.vertFeed = 100
self.horizFeed = 100
self.vertRapid = 100
self.horizRapid = 100
self.radius = 0.25
obj.ToolNumber = 0
obj.ToolDescription = "UNDEFINED"
else:
self.vertFeed = toolLoad.VertFeed.Value
self.horizFeed = toolLoad.HorizFeed.Value
self.vertRapid = toolLoad.VertRapid.Value
self.horizRapid = toolLoad.HorizRapid.Value
tool = PathUtils.getTool(obj, toolLoad.ToolNumber)
if tool.Diameter == 0:
self.radius = 0.25
@@ -485,6 +489,7 @@ class CommandPathProfile:
FreeCADGui.doCommand('obj.Direction = "CW"')
FreeCADGui.doCommand('obj.UseComp = False')
FreeCADGui.doCommand('obj.PlungeAngle = 90.0')
#FreeCADGui.doCommand('obj.ActiveTC = None')
FreeCADGui.doCommand('PathScripts.PathUtils.addToJob(obj)')
FreeCAD.ActiveDocument.commitTransaction()