Added circular faces to drillable targets.
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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()):
|
||||
|
||||
Reference in New Issue
Block a user