From 0eead0d3c64c08930ff9dbb0c62345113b362925 Mon Sep 17 00:00:00 2001 From: sundtek Date: Sun, 19 Dec 2021 19:23:09 +0800 Subject: [PATCH 1/2] change discretize value to fix issues Discretize of 0.0001 is okay for inches, but for metric <1microns would be quite small, this fixes some issues when generating paths for curves that look inward. I found following post in the forum: https://forum.freecadweb.org/viewtopic.php?f=15&t=42755 I have experienced similar issues with other curves in my object. --- src/Mod/Path/PathScripts/PathAdaptive.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Mod/Path/PathScripts/PathAdaptive.py b/src/Mod/Path/PathScripts/PathAdaptive.py index 8368a38892..f62d810553 100644 --- a/src/Mod/Path/PathScripts/PathAdaptive.py +++ b/src/Mod/Path/PathScripts/PathAdaptive.py @@ -33,6 +33,7 @@ import json import math import area +from FreeCAD import Units from PySide import QtCore # lazily loaded modules @@ -104,7 +105,13 @@ def sceneClean(): def discretize(edge, flipDirection=False): - pts = edge.discretize(Deflection=0.0001) + val=Units.Quantity("1mm").getUserPreferred() + if len(val)==3 and val[2]=='mm': + deflection=0.002 + else: + deflection=0.0001 + + pts = edge.discretize(Deflection=deflection) if flipDirection: pts.reverse() From f3ccd77f91803e81d26f81d2ee66bb3cc281ea0f Mon Sep 17 00:00:00 2001 From: sundtek Date: Mon, 20 Dec 2021 01:15:59 +0800 Subject: [PATCH 2/2] Update PathAdaptive.py the internal unit is mm, only lowering the accuracy should be enough. --- src/Mod/Path/PathScripts/PathAdaptive.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathAdaptive.py b/src/Mod/Path/PathScripts/PathAdaptive.py index f62d810553..42a6a9dbee 100644 --- a/src/Mod/Path/PathScripts/PathAdaptive.py +++ b/src/Mod/Path/PathScripts/PathAdaptive.py @@ -33,7 +33,6 @@ import json import math import area -from FreeCAD import Units from PySide import QtCore # lazily loaded modules @@ -105,13 +104,7 @@ def sceneClean(): def discretize(edge, flipDirection=False): - val=Units.Quantity("1mm").getUserPreferred() - if len(val)==3 and val[2]=='mm': - deflection=0.002 - else: - deflection=0.0001 - - pts = edge.discretize(Deflection=deflection) + pts = edge.discretize(Deflection=0.002) if flipDirection: pts.reverse()