From 0eead0d3c64c08930ff9dbb0c62345113b362925 Mon Sep 17 00:00:00 2001 From: sundtek Date: Sun, 19 Dec 2021 19:23:09 +0800 Subject: [PATCH] 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()