From a2fb5b66fa2b173109f9fbe656d2b188273bfaa4 Mon Sep 17 00:00:00 2001 From: Russell Johnson <47639332+Russ4262@users.noreply.github.com> Date: Sat, 12 Mar 2022 18:29:21 -0600 Subject: [PATCH] Path: Fix radius type inconsistency, issue #6170 [Bug] Make `self.radius` a float type throughout since other methods and functions treat it as such. --- src/Mod/Path/PathScripts/PathDressupHoldingTags.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathDressupHoldingTags.py b/src/Mod/Path/PathScripts/PathDressupHoldingTags.py index 098d6f75fc..66e84961c2 100644 --- a/src/Mod/Path/PathScripts/PathDressupHoldingTags.py +++ b/src/Mod/Path/PathScripts/PathDressupHoldingTags.py @@ -134,11 +134,10 @@ class Tag: self.height = math.fabs(height) self.actualHeight = self.height self.angle = math.fabs(angle) - self.radius = ( - radius - if FreeCAD.Units.Quantity == type(radius) - else FreeCAD.Units.Quantity(radius, FreeCAD.Units.Length) - ) + if hasattr(radius, "Value"): + self.radius = radius.Value + else: + self.radius = FreeCAD.Units.Quantity(radius, FreeCAD.Units.Length).Value self.enabled = enabled self.isSquare = False @@ -209,7 +208,7 @@ class Tag: self.solid.translate(orig) radius = min(self.radius, radius) self.realRadius = radius - if not PathGeom.isRoughly(0, radius.Value): + if not PathGeom.isRoughly(0, radius): PathLog.debug("makeFillet(%.4f)" % radius) self.solid = self.solid.makeFillet(radius, [self.solid.Edges[0]])