Merge pull request #383 from sliptonic/bug/drilling

PATH: fix for drilling border case
This commit is contained in:
wwmayer 2016-12-18 09:59:36 +01:00 committed by GitHub
commit 8391af97f0
2 changed files with 13 additions and 2 deletions

View File

@ -134,7 +134,7 @@ class PathWorkbench (Workbench):
if len(FreeCADGui.Selection.getSelection()) == 1:
if FreeCADGui.Selection.getSelection()[0].isDerivedFrom("Path::Feature"):
self.appendContextMenu("", ["Path_Inspect"])
if "Profile" or "Contour" in FreeCADGui.Selection.getSelection()[0].Name:
if FreeCADGui.Selection.getSelection()[0].Name in ["Profile", "Contour"]:
self.appendContextMenu("", ["Add_Tag"])
self.appendContextMenu("", ["Set_StartPoint"])
self.appendContextMenu("", ["Set_EndPoint"])

View File

@ -266,6 +266,12 @@ class ObjectDrilling:
FreeCAD.Console.PrintWarning("Drillable location already in the list" + "\n")
else:
baselist.append(item)
else:
if item in baselist:
FreeCAD.Console.PrintWarning("Drillable location already in the list" + "\n")
else:
baselist.append(item)
if sub[0:4] == 'Edge':
drillableEdges = []
@ -277,7 +283,7 @@ class ObjectDrilling:
if candidateedge.Curve.Radius == o.Curve.Radius and candidateedge.Curve.Center.z == o.Curve.Center.z:
drillableEdges.append("Edge" + str(i+1))
if len(drillableEdges) > 1:
reply = QtGui.QMessageBox.question(None,"","Multiple drillable faces found. Drill them all?",
reply = QtGui.QMessageBox.question(None,"","Multiple drillable edges found. Drill them all?",
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No, QtGui.QMessageBox.No)
if reply == QtGui.QMessageBox.Yes:
for i in drillableEdges:
@ -292,6 +298,11 @@ class ObjectDrilling:
FreeCAD.Console.PrintWarning("Drillable location already in the list" + "\n")
else:
baselist.append(item)
else:
if item in baselist:
FreeCAD.Console.PrintWarning("Drillable location already in the list" + "\n")
else:
baselist.append(item)
print baselist
obj.Base = baselist