Skip to content

Commit

Permalink
Merge pull request #3443 from Russ4262/UnifiedProfile
Browse files Browse the repository at this point in the history
Path:  Combine Contour, Profile Faces and Profile Edges into unified Profile operation
  • Loading branch information
sliptonic committed May 12, 2020
2 parents 99ab82e + a17c3e9 commit 9c27f10
Show file tree
Hide file tree
Showing 16 changed files with 2,335 additions and 2,200 deletions.
4 changes: 2 additions & 2 deletions src/Mod/Path/CMakeLists.txt
Expand Up @@ -87,14 +87,14 @@ SET(PathScripts_SRCS
PathScripts/PathPreferencesPathJob.py
PathScripts/PathProbe.py
PathScripts/PathProbeGui.py
PathScripts/PathProfileBase.py
PathScripts/PathProfileBaseGui.py
PathScripts/PathProfile.py
PathScripts/PathProfileContour.py
PathScripts/PathProfileContourGui.py
PathScripts/PathProfileEdges.py
PathScripts/PathProfileEdgesGui.py
PathScripts/PathProfileFaces.py
PathScripts/PathProfileFacesGui.py
PathScripts/PathProfileGui.py
PathScripts/PathSanity.py
PathScripts/PathSelection.py
PathScripts/PathSetupSheet.py
Expand Down
3 changes: 2 additions & 1 deletion src/Mod/Path/InitGui.py
Expand Up @@ -90,7 +90,8 @@ def Initialize(self):
projcmdlist = ["Path_Job", "Path_Post"]
toolcmdlist = ["Path_Inspect", "Path_Simulator", "Path_ToolLibraryEdit", "Path_SelectLoop", "Path_OpActiveToggle"]
prepcmdlist = ["Path_Fixture", "Path_Comment", "Path_Stop", "Path_Custom", "Path_Probe"]
twodopcmdlist = ["Path_Contour", "Path_Profile_Faces", "Path_Profile_Edges", "Path_Pocket_Shape", "Path_Drilling", "Path_MillFace", "Path_Helix", "Path_Adaptive"]
# twodopcmdlist = ["Path_Profile", "Path_Contour", "Path_Profile_Faces", "Path_Profile_Edges", "Path_Pocket_Shape", "Path_Drilling", "Path_MillFace", "Path_Helix", "Path_Adaptive"]
twodopcmdlist = ["Path_Profile", "Path_Pocket_Shape", "Path_Drilling", "Path_MillFace", "Path_Helix", "Path_Adaptive"]
threedopcmdlist = ["Path_Pocket_3D"]
engravecmdlist = ["Path_Engrave", "Path_Deburr"]
modcmdlist = ["Path_OperationCopy", "Path_Array", "Path_SimpleCopy"]
Expand Down
19 changes: 11 additions & 8 deletions src/Mod/Path/PathScripts/PathAreaOp.py
Expand Up @@ -354,7 +354,7 @@ def opExecute(self, obj, getsim=False): # pylint: disable=arguments-differ
self.tempObjectNames = [] # pylint: disable=attribute-defined-outside-init
self.stockBB = PathUtils.findParentJob(obj).Stock.Shape.BoundBox # pylint: disable=attribute-defined-outside-init
self.useTempJobClones('Delete') # Clear temporary group and recreate for temp job clones
self.profileEdgesIsOpen = False
self.rotStartDepth = None # pylint: disable=attribute-defined-outside-init

if obj.EnableRotation != 'Off':
# Calculate operation heights based upon rotation radii
Expand All @@ -371,6 +371,7 @@ def opExecute(self, obj, getsim=False): # pylint: disable=arguments-differ
strDep = max(self.xRotRad, self.yRotRad)
finDep = -1 * strDep

self.rotStartDepth = strDep
obj.ClearanceHeight.Value = strDep + self.clrOfset
obj.SafeHeight.Value = strDep + self.safOfst

Expand Down Expand Up @@ -419,15 +420,17 @@ def opExecute(self, obj, getsim=False): # pylint: disable=arguments-differ

shapes = [j['shape'] for j in jobs]

if self.profileEdgesIsOpen is True:
if PathOp.FeatureStartPoint & self.opFeatures(obj) and obj.UseStartPoint:
osp = obj.StartPoint
self.commandlist.append(Path.Command('G0', {'X': osp.x, 'Y': osp.y, 'F': self.horizRapid}))

sims = []
numShapes = len(shapes)
for ns in range(0, numShapes):
profileEdgesIsOpen = False
(shape, isHole, sub, angle, axis, strDep, finDep) = shapes[ns] # pylint: disable=unused-variable
if sub == 'OpenEdge':
profileEdgesIsOpen = True
if PathOp.FeatureStartPoint & self.opFeatures(obj) and obj.UseStartPoint:
osp = obj.StartPoint
self.commandlist.append(Path.Command('G0', {'X': osp.x, 'Y': osp.y, 'F': self.horizRapid}))

if ns < numShapes - 1:
nextAxis = shapes[ns + 1][4]
else:
Expand All @@ -436,15 +439,15 @@ def opExecute(self, obj, getsim=False): # pylint: disable=arguments-differ
self.depthparams = self._customDepthParams(obj, strDep, finDep)

try:
if self.profileEdgesIsOpen is True:
if profileEdgesIsOpen:
(pp, sim) = self._buildProfileOpenEdges(obj, shape, isHole, start, getsim)
else:
(pp, sim) = self._buildPathArea(obj, shape, isHole, start, getsim)
except Exception as e: # pylint: disable=broad-except
FreeCAD.Console.PrintError(e)
FreeCAD.Console.PrintError("Something unexpected happened. Check project and tool config.")
else:
if self.profileEdgesIsOpen is True:
if profileEdgesIsOpen:
ppCmds = pp
else:
ppCmds = pp.Commands
Expand Down
7 changes: 4 additions & 3 deletions src/Mod/Path/PathScripts/PathGuiInit.py
Expand Up @@ -64,9 +64,10 @@ def Startup():
from PathScripts import PathPocketShapeGui
from PathScripts import PathPost
from PathScripts import PathProbeGui
from PathScripts import PathProfileContourGui
from PathScripts import PathProfileEdgesGui
from PathScripts import PathProfileFacesGui
# from PathScripts import PathProfileContourGui
# from PathScripts import PathProfileEdgesGui
# from PathScripts import PathProfileFacesGui
from PathScripts import PathProfileGui
from PathScripts import PathSanity
from PathScripts import PathSetupSheetGui
from PathScripts import PathSimpleCopy
Expand Down

0 comments on commit 9c27f10

Please sign in to comment.