Skip to content

Commit

Permalink
Merge pull request #1 from Russ4262/patch-2
Browse files Browse the repository at this point in the history
Path: Fix `ZigZag` pattern; Remove some comments
  • Loading branch information
etrombly committed Apr 25, 2020
2 parents d3eb2ce + 29dfb5b commit dcdfa6c
Showing 1 changed file with 5 additions and 31 deletions.
36 changes: 5 additions & 31 deletions src/Mod/Path/PathScripts/PathWaterline.py
Expand Up @@ -795,36 +795,21 @@ def _getExperimentalWaterlinePaths(self, PNTSET, csHght, cutPattern):
PathLog.debug('_getExperimentalWaterlinePaths()')
SCANS = list()

if cutPattern in ['Line', 'Spiral']:
# PNTSET is list, by stepover.
if cutPattern in ['Line', 'Spiral', 'ZigZag']:
stpOvr = list()
for D in PNTSET:
for SEG in D:
for STEP in PNTSET:
for SEG in STEP:
if SEG == 'BRK':
stpOvr.append(SEG)
else:
# D format is ((p1, p2), (p3, p4))
(A, B) = SEG
P1 = FreeCAD.Vector(A[0], A[1], csHght)
P2 = FreeCAD.Vector(B[0], B[1], csHght)
stpOvr.append((P1, P2))
SCANS.append(stpOvr)
stpOvr = list()
elif cutPattern == 'ZigZag':
stpOvr = list()
for (dirFlg, LNS) in PNTSET:
for SEG in LNS:
if SEG == 'BRK':
stpOvr.append(SEG)
else:
# D format is ((p1, p2), (p3, p4))
(A, B) = SEG
(A, B) = SEG # format is ((p1, p2), (p3, p4))
P1 = FreeCAD.Vector(A[0], A[1], csHght)
P2 = FreeCAD.Vector(B[0], B[1], csHght)
stpOvr.append((P1, P2))
SCANS.append(stpOvr)
stpOvr = list()
elif cutPattern in ['Circular', 'CircularZigZag']:
# PNTSET is list, by stepover.
# Each stepover is a list containing arc/loop descriptions, (sp, ep, cp)
for so in range(0, len(PNTSET)):
stpOvr = list()
Expand Down Expand Up @@ -868,22 +853,13 @@ def _stepTransitionCmds(self, obj, cutPattern, lstPnt, first, minSTH, tolrnc):
if cutPattern in ['Line', 'Circular', 'Spiral']:
if obj.OptimizeStepOverTransitions is True:
height = minSTH + 2.0
# if obj.LayerMode == 'Multi-pass':
# rtpd = minSTH
elif cutPattern in ['ZigZag', 'CircularZigZag']:
if obj.OptimizeStepOverTransitions is True:
zChng = first.z - lstPnt.z
# PathLog.debug('first.z: {}'.format(first.z))
# PathLog.debug('lstPnt.z: {}'.format(lstPnt.z))
# PathLog.debug('zChng: {}'.format(zChng))
# PathLog.debug('minSTH: {}'.format(minSTH))
if abs(zChng) < tolrnc: # transitions to same Z height
# PathLog.debug('abs(zChng) < tolrnc')
if (minSTH - first.z) > tolrnc:
# PathLog.debug('(minSTH - first.z) > tolrnc')
height = minSTH + 2.0
else:
# PathLog.debug('ELSE (minSTH - first.z) > tolrnc')
horizGC = 'G1'
height = first.z
elif (minSTH + (2.0 * tolrnc)) >= max(first.z, lstPnt.z):
Expand Down Expand Up @@ -1302,8 +1278,6 @@ def _experimentalWaterlineOp(self, JOB, obj, mdlIdx, subShp=None):
commands = []
t_begin = time.time()
base = JOB.Model.Group[mdlIdx]
# bb = self.boundBoxes[mdlIdx]
# stl = self.modelSTLs[mdlIdx]
# safeSTL = self.safeSTLs[mdlIdx]
self.endVector = None

Expand Down

0 comments on commit dcdfa6c

Please sign in to comment.