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.
This commit is contained in:
Chris Nisbet
2021-03-28 16:47:24 +13:00
parent a3c2190c35
commit eda4266fe2

View File

@@ -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)