From eda4266fe2fc67a75c2a4e6770cf934b1573bce5 Mon Sep 17 00:00:00 2001 From: Chris Nisbet Date: Sun, 28 Mar 2021 16:47:24 +1300 Subject: [PATCH] Path: vcarve - Fix depth calculation Depths were being calculated incorrectly due to MIC distance getting divided by scaling factor rather than multiplied by it. The scaling factor is the inverse of the tan of half the cutting tool angle, so for a 30 degree bit (say), the scaling factor would be 1 / tan(30/2), or 3.7320. When given an MIC (which is a radius) of 3.175 (say), and cutting to the same width with a 30 degree bit, the depth should be 3.175 * 3.7320 (11..849), not 3.175 / 3.7320 (0.8509) as it is currently. --- src/Mod/Path/PathScripts/PathVcarve.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mod/Path/PathScripts/PathVcarve.py b/src/Mod/Path/PathScripts/PathVcarve.py index 22c974d108..4b93ed1ad3 100644 --- a/src/Mod/Path/PathScripts/PathVcarve.py +++ b/src/Mod/Path/PathScripts/PathVcarve.py @@ -186,7 +186,7 @@ class _Geometry(object): def _calculate_depth(MIC, geom): # given a maximum inscribed circle (MIC) and tool angle, # return depth of cut relative to zStart. - depth = geom.start - round(MIC / geom.scale, 4) + depth = geom.start - round(MIC * geom.scale, 4) PathLog.debug('zStart value: {} depth: {}'.format(geom.start, depth)) return max(depth, geom.stop)