Skip to content

Commit

Permalink
Merge branch 'master' into flake8_config
Browse files Browse the repository at this point in the history
  • Loading branch information
gwicke committed May 31, 2020
2 parents 834acec + 58b86ad commit 2af8e8b
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 43 deletions.
2 changes: 1 addition & 1 deletion src/Mod/Fem/femtest/data/elmer/group_mesh.geo
Expand Up @@ -22,7 +22,7 @@ Mesh.HighOrderOptimize = 0; // for more HighOrderOptimize parameter check http:

// mesh order
Mesh.ElementOrder = 2;
Mesh.SecondOrderLinear = 1; // Second order nodes are created by linear interpolation instead by curvilinear
Mesh.SecondOrderLinear = 0; // Second order nodes are created by linear interpolation instead by curvilinear

// mesh algorithm, only a few algorithms are usable with 3D boundary layer generation
// 2D mesh algorithm (1=MeshAdapt, 2=Automatic, 5=Delaunay, 6=Frontal, 7=BAMG, 8=DelQuad)
Expand Down
92 changes: 50 additions & 42 deletions src/Mod/Path/PathScripts/PathSurface.py
Expand Up @@ -1385,48 +1385,56 @@ def _planarMultipassProcess(self, obj, PNTS, lMax):
PNTS.pop() # Remove temp end point

return output

def _stepTransitionCmds(self, obj, lstPnt, first, minSTH, tolrnc):
cmds = list()
rtpd = False
horizGC = 'G0'
hSpeed = self.horizRapid
height = obj.SafeHeight.Value

if obj.CutPattern in ['Line', 'Circular']:
if obj.OptimizeStepOverTransitions is True:
height = minSTH + 2.0
# if obj.LayerMode == 'Multi-pass':
# rtpd = minSTH
elif obj.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):
height = False # allow end of Zig to cut to beginning of Zag


# Create raise, shift, and optional lower commands
if height is not False:
cmds.append(Path.Command('G0', {'Z': height, 'F': self.vertRapid}))
cmds.append(Path.Command(horizGC, {'X': first.x, 'Y': first.y, 'F': hSpeed}))
if rtpd is not False: # ReturnToPreviousDepth
cmds.append(Path.Command('G0', {'Z': rtpd, 'F': self.vertRapid}))

return cmds


def _stepTransitionCmds(self, obj, lstPnt, first, minSTH, tolrnc):
cmds = list()
rtpd = False
horizGC = 'G0'
hSpeed = self.horizRapid
height = obj.SafeHeight.Value
maxXYDistanceSqrd = (self.cutter.getDiameter() + tolrnc)**2

if obj.OptimizeStepOverTransitions is True:
# Short distance within step over
xyDistanceSqrd = (abs(first.x - lstPnt.x)**2 +
abs(first.y - lstPnt.y)**2)
zChng = abs(first.z - lstPnt.z)
# Only optimize short distances <= cutter diameter. Staying at
# minSTH over long distances is not safe for multi layer paths,
# since minSTH is calculated from the model, and not based on
# stock cut so far.
if xyDistanceSqrd <= maxXYDistanceSqrd:
horizGC = "G1"
hSpeed = self.horizFeed
if (minSTH <= max(first.z, lstPnt.z) + tolrnc
and zChng < tolrnc):
# Allow direct transition without any lift over short
# distances, and only when there is very little z change.
height = False
else:
# Avoid a full lift, but stay at least at minSTH along the
# entire transition.
# TODO: Consider using an actual scan path for the
# transition.
height = max(minSTH, first.z, lstPnt.z)
else:
# We conservatively lift to SafeHeight for lack of an accurate
# stock model, but then speed up the drop back down
# When using multi pass, only drop quickly to previous layer
# depth
stepDown = obj.StepDown.Value if hasattr(obj, "StepDown") else 0
rtpd = min(height,
max(minSTH, first.z, lstPnt.z) + stepDown + 2)

# Create raise, shift, and optional lower commands
if height is not False:
cmds.append(Path.Command('G0', {'Z': height, 'F': self.vertRapid}))
cmds.append(Path.Command(horizGC, {'X': first.x, 'Y': first.y, 'F': hSpeed}))
if rtpd is not False: # ReturnToPreviousDepth
cmds.append(Path.Command('G0', {'Z': rtpd, 'F': self.vertRapid}))

return cmds

def _breakCmds(self, obj, lstPnt, first, minSTH, tolrnc):
cmds = list()
rtpd = False
Expand Down

0 comments on commit 2af8e8b

Please sign in to comment.