PATH: Drilling: allow selection of partial circular edges
This commit is contained in:
@@ -195,7 +195,7 @@ class ObjectDrilling:
|
||||
if isinstance(subobj.Edges[0].Curve, Part.Circle):
|
||||
drillable = True
|
||||
if str(subobj.Surface) == "<Cylinder object>":
|
||||
drillable = True
|
||||
drillable = subobj.isClosed()
|
||||
if len(subobj.Edges) == 3:
|
||||
cedge = []
|
||||
ledge = []
|
||||
@@ -211,7 +211,7 @@ class ObjectDrilling:
|
||||
drillable = False
|
||||
if sub[0:4] == 'Edge':
|
||||
o = obj.getElement(sub)
|
||||
if isinstance(o.Curve, Part.Circle) and len(o.Vertexes) == 1:
|
||||
if isinstance(o.Curve, Part.Circle):
|
||||
drillable = True
|
||||
|
||||
return drillable
|
||||
@@ -266,9 +266,37 @@ class ObjectDrilling:
|
||||
FreeCAD.Console.PrintWarning("Drillable location already in the list" + "\n")
|
||||
else:
|
||||
baselist.append(item)
|
||||
print baselist
|
||||
obj.Base = baselist
|
||||
self.execute(obj)
|
||||
|
||||
if sub[0:4] == 'Edge':
|
||||
drillableEdges = []
|
||||
o = ss.Shape.getElement(sub)
|
||||
|
||||
for i in range(len(ss.Shape.Edges)):
|
||||
candidateedge = ss.Shape.getElement("Edge" + str(i+1))
|
||||
if self.checkdrillable(ss.Shape, "Edge" + str(i+1)):
|
||||
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?",
|
||||
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No, QtGui.QMessageBox.No)
|
||||
if reply == QtGui.QMessageBox.Yes:
|
||||
for i in drillableEdges:
|
||||
if i in baselist:
|
||||
FreeCAD.Console.PrintWarning("Drillable location already in the list" + "\n")
|
||||
continue
|
||||
else:
|
||||
newitem = (ss, i)
|
||||
baselist.append(newitem)
|
||||
else:
|
||||
if item in baselist:
|
||||
FreeCAD.Console.PrintWarning("Drillable location already in the list" + "\n")
|
||||
else:
|
||||
baselist.append(item)
|
||||
|
||||
print baselist
|
||||
obj.Base = baselist
|
||||
self.execute(obj)
|
||||
|
||||
|
||||
class _ViewProviderDrill:
|
||||
def __init__(self, obj):
|
||||
|
||||
@@ -332,11 +332,8 @@ class TaskPanel:
|
||||
else:
|
||||
for o in FreeCADGui.Selection.getCompleteSelection():
|
||||
baseindex = self.form.cboBaseObject.findText(o.Name, QtCore.Qt.MatchFixedString)
|
||||
print baseindex
|
||||
if baseindex >= 0:
|
||||
self.form.cboBaseObject.blockSignals(True)
|
||||
self.form.cboBaseObject.setCurrentIndex(baseindex)
|
||||
self.form.cboBaseObject.blockSignals(False)
|
||||
|
||||
|
||||
def open(self):
|
||||
|
||||
@@ -105,7 +105,7 @@ class DRILLGate:
|
||||
subobj = obj.getElement(sub)
|
||||
drillable = isinstance(subobj.Edges[0].Curve, Part.Circle)
|
||||
if str(subobj.Surface) == "<Cylinder object>":
|
||||
drillable = True
|
||||
drillable = subobj.isClosed()
|
||||
|
||||
if sub[0:4] == 'Edge':
|
||||
o = obj.getElement(sub)
|
||||
|
||||
Reference in New Issue
Block a user