Path: fix bug in drilling

hemispherical faces have an odd edge that doesn't have a Curve attribute.
This commit is contained in:
sliptonic
2017-06-11 14:25:51 -05:00
committed by Yorik van Havre
parent 7048ce77c3
commit 239514e825
3 changed files with 19 additions and 16 deletions

View File

@@ -39,7 +39,7 @@ if sys.version_info.major >= 3:
LOG_MODULE = 'PathDrilling'
PathLog.setLevel(PathLog.Level.INFO, LOG_MODULE)
PathLog.trackModule('PathDrilling')
#PathLog.trackModule('PathDrilling')
FreeCADGui = None
if FreeCAD.GuiUp:

View File

@@ -38,7 +38,7 @@ if FreeCAD.GuiUp:
LOG_MODULE = 'PathPocket'
PathLog.setLevel(PathLog.Level.INFO, LOG_MODULE)
#PathLog.trackModule('PathPocket')
PathLog.trackModule('PathPocket')
FreeCAD.setLogLevel('Path.Area', 0)
@@ -172,7 +172,7 @@ class ObjectPocket:
stepover = (self.radius * 2) * (float(obj.StepOver)/100)
pocketparams = {'Fill': 0,
pocketparams = {'Fill': 2,
'Coplanar': 0,
'PocketMode': 1,
'SectionCount': -1,
@@ -249,12 +249,17 @@ class ObjectPocket:
PathLog.debug("Base item: {}".format(b))
for sub in b[1]:
if "Face" in sub:
shape = getattr(b[0].Shape, sub)
shape = Part.makeCompound([getattr(b[0].Shape, sub)])
#shape = getattr(b[0].Shape, sub)
else:
edges = [getattr(b[0].Shape, sub) for sub in b[1]]
shape = Part.makeFace(edges, 'Part::FaceMakerSimple')
env = PathUtils.getEnvelope(baseobject.Shape, subshape=shape, stockheight=obj.StartDepth)
if PathLog.getLevel(PathLog.thisModule()) == PathLog.Level.DEBUG:
removalshape=FreeCAD.ActiveDocument.addObject("Part::Feature","removalshape")
removalshape.Shape = env.cut(baseobject.Shape)
try:
commandlist.extend(self._buildPathArea(obj, env.cut(baseobject.Shape)).Commands)
except Exception as e:

View File

@@ -260,18 +260,16 @@ class ObjectProfile:
FreeCAD.Console.PrintWarning ("found a base object which is not a face. Can't continue.")
return
if obj.processHoles:
for wire in holes:
f = Part.makeFace(wire, 'Part::FaceMakerSimple')
drillable = PathUtils.isDrillable(baseobject.Shape, wire)
if (drillable and obj.processCircles) or (not drillable and obj.processHoles):
env = PathUtils.getEnvelope(baseobject.Shape, subshape=f, stockheight=obj.StartDepth)
try:
commandlist.extend(self._buildPathArea(obj, baseobject=env, isHole=True, start=None).Commands)
except Exception as e:
FreeCAD.Console.PrintError(e)
FreeCAD.Console.PrintError("Something unexpected happened. Unable to generate a contour path. Check project and tool config.")
for wire in holes:
f = Part.makeFace(wire, 'Part::FaceMakerSimple')
drillable = PathUtils.isDrillable(baseobject.Shape, wire)
if (drillable and obj.processCircles) or (not drillable and obj.processHoles):
env = PathUtils.getEnvelope(baseobject.Shape, subshape=f, stockheight=obj.StartDepth)
try:
commandlist.extend(self._buildPathArea(obj, baseobject=env, isHole=True, start=None).Commands)
except Exception as e:
FreeCAD.Console.PrintError(e)
FreeCAD.Console.PrintError("Something unexpected happened. Unable to generate a contour path. Check project and tool config.")
if len(faces) > 0:
profileshape = Part.makeCompound(faces)