Merge pull request #8186 from mlampert/bugfix/issue-8185-deburr-offset-calculation

[Path] Bugfix/issue 8185 deburr offset calculation
This commit is contained in:
sliptonic
2023-01-16 16:14:25 -06:00
committed by GitHub
5 changed files with 29 additions and 15 deletions

View File

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

View File

@@ -185,7 +185,7 @@
</size>
</property>
<property name="text">
<string>W =</string>
<string notr="true">W =</string>
</property>
</widget>
</item>
@@ -212,7 +212,7 @@
</size>
</property>
<property name="text">
<string>h = </string>
<string notr="true">h = </string>
</property>
</widget>
</item>

View File

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

View File

@@ -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()
@@ -92,19 +92,33 @@ class TestPathDeburr(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):

View File

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