From dfb08cda3fe75c545ac333c1e07427a655d59ca4 Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Wed, 11 Jan 2023 22:02:33 -0800 Subject: [PATCH 1/3] Renamed Deburr test suite --- src/Mod/Path/CMakeLists.txt | 2 +- .../Path/PathTests/{TestPathDeburr.py => TestPathOpDeburr.py} | 2 +- src/Mod/Path/TestPathApp.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) rename src/Mod/Path/PathTests/{TestPathDeburr.py => TestPathOpDeburr.py} (99%) diff --git a/src/Mod/Path/CMakeLists.txt b/src/Mod/Path/CMakeLists.txt index 94d250bdf7..1d80c40c3d 100644 --- a/src/Mod/Path/CMakeLists.txt +++ b/src/Mod/Path/CMakeLists.txt @@ -288,7 +288,6 @@ SET(PathTests_SRCS PathTests/TestMach3Mach4Post.py PathTests/TestPathAdaptive.py PathTests/TestPathCore.py - PathTests/TestPathDeburr.py PathTests/TestPathDepthParams.py PathTests/TestPathDressupDogbone.py PathTests/TestPathDressupDogboneII.py @@ -302,6 +301,7 @@ SET(PathTests_SRCS PathTests/TestPathHelixGenerator.py PathTests/TestPathLanguage.py PathTests/TestPathLog.py + PathTests/TestPathOpDeburr.py PathTests/TestPathOpUtil.py PathTests/TestPathPost.py PathTests/TestPathPreferences.py diff --git a/src/Mod/Path/PathTests/TestPathDeburr.py b/src/Mod/Path/PathTests/TestPathOpDeburr.py similarity index 99% rename from src/Mod/Path/PathTests/TestPathDeburr.py rename to src/Mod/Path/PathTests/TestPathOpDeburr.py index 62eb793702..811db63b84 100644 --- a/src/Mod/Path/PathTests/TestPathDeburr.py +++ b/src/Mod/Path/PathTests/TestPathOpDeburr.py @@ -36,7 +36,7 @@ class MockToolBit(object): self.CuttingEdgeAngle = 60 -class TestPathDeburr(PathTestUtils.PathTestBase): +class TestPathOpDeburr(PathTestUtils.PathTestBase): def test00(self): """Verify chamfer depth and offset for an end mill.""" tool = MockToolBit() diff --git a/src/Mod/Path/TestPathApp.py b/src/Mod/Path/TestPathApp.py index 00328d2e59..88fb9307a8 100644 --- a/src/Mod/Path/TestPathApp.py +++ b/src/Mod/Path/TestPathApp.py @@ -24,7 +24,6 @@ import TestApp from PathTests.TestPathAdaptive import TestPathAdaptive from PathTests.TestPathCore import TestPathCore -from PathTests.TestPathDeburr import TestPathDeburr from PathTests.TestPathDepthParams import depthTestCases from PathTests.TestPathDressupDogbone import TestDressupDogbone from PathTests.TestPathDressupDogboneII import TestDressupDogboneII @@ -34,6 +33,7 @@ from PathTests.TestPathDrillGenerator import TestPathDrillGenerator from PathTests.TestPathGeneratorDogboneII import TestGeneratorDogboneII from PathTests.TestPathGeom import TestPathGeom from PathTests.TestPathLanguage import TestPathLanguage +from PathTests.TestPathOpDeburr import TestPathOpDeburr # from PathTests.TestPathHelix import TestPathHelix from PathTests.TestPathHelpers import TestPathHelpers @@ -82,7 +82,7 @@ False if TestPathLanguage.__name__ else True False if TestOutputNameSubstitution.__name__ else True False if TestPathAdaptive.__name__ else True False if TestPathCore.__name__ else True -False if TestPathDeburr.__name__ else True +False if TestPathOpDeburr.__name__ else True False if TestPathDrillable.__name__ else True False if TestPathGeom.__name__ else True False if TestPathHelpers.__name__ else True From 39646e39e0efe1cf8d9f64b17fb982b661cb62a9 Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Fri, 13 Jan 2023 20:38:58 -0800 Subject: [PATCH 2/3] Fixed offset and depth calculation for Deburr op --- src/Mod/Path/Path/Op/Deburr.py | 2 +- src/Mod/Path/PathTests/TestPathOpDeburr.py | 30 ++++++++++++++++------ 2 files changed, 23 insertions(+), 9 deletions(-) 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): From 96faf9fb5c65e8bb8ef622a6a460fdcaab5a4daf Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Fri, 13 Jan 2023 23:19:26 -0800 Subject: [PATCH 3/3] Remove translation for h=/W= labels --- src/Mod/Path/Gui/Resources/panels/PageOpDeburrEdit.ui | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Mod/Path/Gui/Resources/panels/PageOpDeburrEdit.ui b/src/Mod/Path/Gui/Resources/panels/PageOpDeburrEdit.ui index 5e05f83cbe..1941e4c923 100644 --- a/src/Mod/Path/Gui/Resources/panels/PageOpDeburrEdit.ui +++ b/src/Mod/Path/Gui/Resources/panels/PageOpDeburrEdit.ui @@ -185,7 +185,7 @@ - W = + W = @@ -212,7 +212,7 @@ - h = + h =