Skip to content

Commit

Permalink
Merge pull request #1415 from apshu/master
Browse files Browse the repository at this point in the history
Driller improvements, Manual drillmark improvement, code review improvement
  • Loading branch information
Harvie authored May 30, 2020
2 parents 4880d6b + bd575de commit 80d6e92
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
13 changes: 12 additions & 1 deletion bCNC/CNC.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def load(self, filename=None):
def read(f):
while True:
line = f.readline()
if len(line)==0: raise
assert line , "Read an empty line, please check file IO settings"
line = line.strip()
if line: return map(float, line.split())

Expand Down Expand Up @@ -3439,6 +3439,17 @@ def drill(self, items, depth=None, peck=None, dwell=None, distance=None, number=
opname = "drill"
else:
opname = "drill:%g"%(depth)
#Incorrect peck values can block drilling cycle calculation
peck = peck or 0.0
if peck == 0.0:
peck = None
if peck is not None:
if math.copysign(1.0, depth) * math.copysign(1.0, peck) != -1:
pecksignstr = "less"
if math.copysign(1.0, peck) < 0:
pecksignstr = "greater"
return "Invalid peck depth value of %g. In this configuration, peck value should be %s than zero."%(peck, pecksignstr)
#pecking value is well defined.

undoinfo = []

Expand Down
15 changes: 15 additions & 0 deletions bCNC/ToolsPage.py
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,21 @@ def __init__(self, master):
("distance", "mm" , "", _("Distance (mm)")),
("number", "int" , "", _("Number"))
]
self.help = """Drill a hole in the center of the selected path or drill many holes along the selected path.
MODULE PARAMETERS:
* center : if checked, there is only one drill in the center of the selected path. (Otherwise drill along path)
* depth : Depth of the drill. If not provided, stock material thickness is used. (usually negative value)
* peck: Peck step depth. If provided, drill with peck depth step, raising the drill to z travel value. If not provided, one pass drill is generated.
* dwell: Dwell time at the bottom. If pecking is defined, dwell also at lifted height.
* distance: Distance between drills if drilling alog path. (Number of drills will superceed this parameter))
* number: Number of drills if drilling along path. If nonzero, Parameter 'distance' has no effect."""
self.buttons.append("exe")

# ----------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion bCNC/plugins/drillmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,4 +183,4 @@ def execute(self, app):
blocks = [block]
app.gcode.insBlocks(active, blocks, _("Manual drill mark"))
app.refresh() # <<< refresh editor
app.setStatus(_("Generated: MyPlugin Result"))
app.setStatus(_("Generated: Manual drillmark"))

0 comments on commit 80d6e92

Please sign in to comment.