From 48a0a50d5013c7143ac1634188e45d2fca09105d Mon Sep 17 00:00:00 2001 From: IMback Date: Sun, 11 Aug 2019 17:09:56 +0200 Subject: [PATCH] Changed hole diameter detection to avoid tessilation inaccuracies in more cases. --- src/Mod/Path/PathScripts/PathCircularHoleBase.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathCircularHoleBase.py b/src/Mod/Path/PathScripts/PathCircularHoleBase.py index 0c4bec33de..f97d85451c 100644 --- a/src/Mod/Path/PathScripts/PathCircularHoleBase.py +++ b/src/Mod/Path/PathScripts/PathCircularHoleBase.py @@ -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)