Path: Initiate unification of ProfileFaces and ProfileEdges operations

ProfileFaces now accepts and processes faces and edges.
Full functionality is maintained (so far as tested) with respect to original operations.
This commit is contained in:
Russell Johnson
2020-05-05 13:20:08 -05:00
parent 25fc5137d6
commit c5e577be89
3 changed files with 990 additions and 77 deletions

View File

@@ -354,7 +354,7 @@ class ObjectOp(PathOp.ObjectOp):
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
@@ -371,6 +371,7 @@ class ObjectOp(PathOp.ObjectOp):
strDep = max(self.xRotRad, self.yRotRad)
finDep = -1 * strDep
self.rotStartDepth = strDep
obj.ClearanceHeight.Value = strDep + self.clrOfset
obj.SafeHeight.Value = strDep + self.safOfst
@@ -419,15 +420,17 @@ class ObjectOp(PathOp.ObjectOp):
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:
@@ -436,7 +439,7 @@ class ObjectOp(PathOp.ObjectOp):
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)
@@ -444,7 +447,7 @@ class ObjectOp(PathOp.ObjectOp):
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

File diff suppressed because it is too large Load Diff

View File

@@ -209,7 +209,11 @@ def chamferselect():
def profileselect():
FreeCADGui.Selection.addSelectionGate(PROFILEGate())
gate = False
if(PROFILEGate() or EGate()):
gate = True
FreeCADGui.Selection.addSelectionGate(gate)
# FreeCADGui.Selection.addSelectionGate(PROFILEGate())
FreeCAD.Console.PrintWarning("Profiling Select Mode\n")
@@ -249,6 +253,7 @@ def select(op):
opsel['Pocket Shape'] = pocketselect
opsel['Profile Edges'] = eselect
opsel['Profile Faces'] = profileselect
opsel['Profile'] = profileselect
opsel['Surface'] = surfaceselect
opsel['Waterline'] = surfaceselect
opsel['Adaptive'] = adaptiveselect