diff --git a/src/Mod/Path/Path/Op/Deburr.py b/src/Mod/Path/Path/Op/Deburr.py index 9ad1893ac9..3dfcfc614d 100644 --- a/src/Mod/Path/Path/Op/Deburr.py +++ b/src/Mod/Path/Path/Op/Deburr.py @@ -96,7 +96,7 @@ def toolDepthAndOffset(width, extraDepth, tool, printInfo): toolDepth = 0 if Path.Geom.isRoughly(tan, 0) else width / tan depth = toolDepth + extraDepth - extraOffset = -width if angle == 180 else (extraDepth / tan) + extraOffset = -width if angle == 180 else (extraDepth * tan) offset = toolOffset + extraOffset return (depth, offset, extraOffset, suppressInfo) diff --git a/src/Mod/Path/PathTests/TestPathOpDeburr.py b/src/Mod/Path/PathTests/TestPathOpDeburr.py index 811db63b84..7872e3b985 100644 --- a/src/Mod/Path/PathTests/TestPathOpDeburr.py +++ b/src/Mod/Path/PathTests/TestPathOpDeburr.py @@ -92,19 +92,33 @@ class TestPathOpDeburr(PathTestUtils.PathTestBase): def test03(self): """Verify chamfer depth and offset for a 60 deg v-bit with non 0 flat radius.""" tool = MockToolBit() - tool.FlatRadius = 10 + tool.FlatRadius = 0.1 tool.CuttingEdgeAngle = 60 - td = 1.73205 - - (depth, offset, __, info) = PathDeburr.toolDepthAndOffset(1, 0, tool, True) - self.assertRoughly(td, depth) - self.assertRoughly(10, offset) + (depth, offset, __, info) = PathDeburr.toolDepthAndOffset(1, 0.5, tool, True) + self.assertRoughly(2.232051, depth) + self.assertRoughly(0.388675, offset) self.assertFalse(info) (depth, offset, __, info) = PathDeburr.toolDepthAndOffset(3, 1, tool, True) - self.assertRoughly(td * 3 + 1, depth) - self.assertRoughly(10 + td, offset) + self.assertRoughly(6.196153, depth) + self.assertRoughly(0.677350, offset) + self.assertFalse(info) + + def test04(self): + """Verify chamfer depth and offset for a 30 deg v-bit with non 0 flat radius.""" + tool = MockToolBit() + tool.FlatRadius = 0.1 + tool.CuttingEdgeAngle = 30 + + (depth, offset, __, info) = PathDeburr.toolDepthAndOffset(1, 0.5, tool, True) + self.assertRoughly(4.232051, depth) + self.assertRoughly(0.233975, offset) + self.assertFalse(info) + + (depth, offset, __, info) = PathDeburr.toolDepthAndOffset(3, 1, tool, True) + self.assertRoughly(12.196155, depth) + self.assertRoughly(0.367949, offset) self.assertFalse(info) def test10(self):