Changed hole diameter detection to avoid tessilation inaccuracies in more cases.

This commit is contained in:
IMback
2019-08-11 17:09:56 +02:00
parent 3366209789
commit 48a0a50d50

View File

@@ -141,8 +141,15 @@ class ObjectOp(PathOp.ObjectOp):
if shape.ShapeType == 'Edge' and type(shape.Curve) == Part.Circle:
return shape.Curve.Radius * 2
# for all other shapes the diameter is just the dimension in X
if shape.ShapeType == 'Face':
for i in range(len(shape.Edges)):
if type(shape.Edges[i].Curve) == Part.Circle:
return shape.Edges[i].Curve.Radius * 2
# for all other shapes the diameter is just the dimension in X. This may be inaccurate as the BoundBox is calculated on the tesselated geometry
PathLog.warning(translate("Path", "Hole diameter may be inaccurate due to tessellation on face. Consider selecting hole edge."))
return shape.BoundBox.XLength
except Part.OCCError as e:
PathLog.error(e)