Added circular faces to drillable targets.

This commit is contained in:
Markus Lampert
2017-12-03 15:08:12 -08:00
parent 7588081afd
commit 25e92ca25b
2 changed files with 8 additions and 4 deletions

View File

@@ -133,8 +133,11 @@ class ObjectOp(PathOp.ObjectOp):
if shape.ShapeType == 'Edge' and hasattr(shape.Curve, 'Center'):
return FreeCAD.Vector(shape.Curve.Center.x, shape.Curve.Center.y, 0)
if shape.ShapeType == 'Face' and hasattr(shape.Surface, 'Center'):
return FreeCAD.Vector(shape.Surface.Center.x, shape.Surface.Center.y, 0)
if shape.ShapeType == 'Face':
if hasattr(shape.Surface, 'Center'):
return FreeCAD.Vector(shape.Surface.Center.x, shape.Surface.Center.y, 0)
if len(shape.Edges) == 1 and type(shape.Edges[0].Curve) == Part.Circle:
return shape.Edges[0].Curve.Center
PathLog.error(translate("Path", "Feature %s.%s cannot be processed as a circular hole - please remove from Base geometry list.") % (base.Label, sub))
return None
@@ -158,8 +161,6 @@ class ObjectOp(PathOp.ObjectOp):
return len(obj.Locations) != 0
return False
# if len(obj.Base) == 0 and not haveLocations(self, obj):
holes = []
for base, subs in obj.Base:

View File

@@ -164,6 +164,9 @@ def isDrillable(obj, candidate, tooldiameter=None, includePartials=False):
drillable = face.Surface.Radius >= tooldiameter/2
else:
drillable = True
elif type(face.Surface) == Part.Plane and PathGeom.pointsCoincide(face.Surface.Axis, FreeCAD.Vector(0,0,1)):
if len(face.Edges) == 1 and type(face.Edges[0].Curve) == Part.Circle:
return True
else:
for edge in candidate.Edges:
if isinstance(edge.Curve, Part.Circle) and (includePartials or edge.isClosed()):