PATH: Feature/dogbone ii (#7660)
* Start of new dogbone dressup * Added Instruction and tangents support for G2/3 moves * Added Maneuver class to represent a set of moves and process them coherently * Created kinks and verify their creation. * Added dogbone detection and verification * Simplified gcode strings * Added horizontal t-bones generation * Added support for vertical t-bone * Consolidated t-bone creation * Added support for pathLength * Added support for tbone on short edge * Added support for long edges * Added support for dogbones * Fixed dogbone for non-horizontal lead-in * Horizontal bone adaptive length tests * Fixed dogbone angle and adaptive length * Some code cleanup * Added adaptive length tests for dogbones * Split base data classes into their own PathLanguage module. * Splitting dogboneII implementation into its constituents * Moved adaptive length into DogbonII module * Separate dogboneII generator test cases and changed interface to allow for dynamic length calculations * Unit tests for length calculation * Initial DogboneII unit test * Unit tests and fixes for plunge move handling * Unit tests for the remaining styles and incision strategies * Basic DogboneII gui * Added support for markers * Better color and selection scheme for markers * Cleaned up import statements * Added DogboneII to Path WB init * Support for dogbone on dogbone and fixed t-bone generation * Fixed t-bone on short leg bones * Fixed tbone on short edge when short edge is m1 * Fixed t-bone on long edge for m0/m1 and CW/CCW * Removed redundant code * Removed redundant 'Dress-up' from menu entries * black code formatting * added generator to cmake * Fixed typos
This commit is contained in:
@@ -29,13 +29,13 @@ from PathTests.PathTestUtils import PathTestBase
|
||||
|
||||
|
||||
class TestObject(object):
|
||||
|
||||
def __init__(self, orientation, direction, zTop, zBottom):
|
||||
self.ThreadOrientation = orientation
|
||||
self.Direction = direction
|
||||
self.StartDepth = FreeCAD.Units.Quantity(zTop, FreeCAD.Units.Length)
|
||||
self.FinalDepth = FreeCAD.Units.Quantity(zBottom, FreeCAD.Units.Length)
|
||||
|
||||
|
||||
def radii(internal, major, minor, toolDia, toolCrest):
|
||||
"""test radii function for simple testing"""
|
||||
if internal:
|
||||
@@ -56,13 +56,17 @@ class TestPathThreadMilling(PathTestBase):
|
||||
self.assertRoughly(have[i], want[i])
|
||||
|
||||
def assertSetupInternal(self, obj, c, begin, end):
|
||||
cmd, zBegin, zEnd = PathThreadMilling.threadSetupInternal(obj, obj.StartDepth.Value, obj.FinalDepth.Value)
|
||||
cmd, zBegin, zEnd = PathThreadMilling.threadSetupInternal(
|
||||
obj, obj.StartDepth.Value, obj.FinalDepth.Value
|
||||
)
|
||||
self.assertEqual(cmd, c)
|
||||
self.assertEqual(zBegin, begin)
|
||||
self.assertEqual(zEnd, end)
|
||||
|
||||
def assertSetupExternal(self, obj, c, begin, end):
|
||||
cmd, zBegin, zEnd = PathThreadMilling.threadSetupExternal(obj, obj.StartDepth.Value, obj.FinalDepth.Value)
|
||||
cmd, zBegin, zEnd = PathThreadMilling.threadSetupExternal(
|
||||
obj, obj.StartDepth.Value, obj.FinalDepth.Value
|
||||
)
|
||||
self.assertEqual(cmd, c)
|
||||
self.assertEqual(zBegin, begin)
|
||||
self.assertEqual(zEnd, end)
|
||||
@@ -120,30 +124,45 @@ class TestPathThreadMilling(PathTestBase):
|
||||
|
||||
hand = PathThreadMilling.RightHand
|
||||
|
||||
self.assertSetupInternal(TestObject(hand, PathThreadMilling.DirectionConventional, 1, 0), "G2", 1, 0)
|
||||
self.assertSetupInternal(TestObject(hand, PathThreadMilling.DirectionClimb, 1, 0), "G3", 0, 1)
|
||||
self.assertSetupInternal(
|
||||
TestObject(hand, PathThreadMilling.DirectionConventional, 1, 0), "G2", 1, 0
|
||||
)
|
||||
self.assertSetupInternal(
|
||||
TestObject(hand, PathThreadMilling.DirectionClimb, 1, 0), "G3", 0, 1
|
||||
)
|
||||
|
||||
def test41(self):
|
||||
"""Verify internal left hand thread setup."""
|
||||
|
||||
hand = PathThreadMilling.LeftHand
|
||||
|
||||
self.assertSetupInternal(TestObject(hand, PathThreadMilling.DirectionConventional, 1, 0), "G2", 0, 1)
|
||||
self.assertSetupInternal(TestObject(hand, PathThreadMilling.DirectionClimb, 1, 0), "G3", 1, 0)
|
||||
self.assertSetupInternal(
|
||||
TestObject(hand, PathThreadMilling.DirectionConventional, 1, 0), "G2", 0, 1
|
||||
)
|
||||
self.assertSetupInternal(
|
||||
TestObject(hand, PathThreadMilling.DirectionClimb, 1, 0), "G3", 1, 0
|
||||
)
|
||||
|
||||
def test50(self):
|
||||
"""Verify exteranl right hand thread setup."""
|
||||
|
||||
hand = PathThreadMilling.RightHand
|
||||
|
||||
self.assertSetupExternal(TestObject(hand, PathThreadMilling.DirectionClimb, 1, 0), "G2", 1, 0)
|
||||
self.assertSetupExternal(TestObject(hand, PathThreadMilling.DirectionConventional, 1, 0), "G3", 0, 1)
|
||||
self.assertSetupExternal(
|
||||
TestObject(hand, PathThreadMilling.DirectionClimb, 1, 0), "G2", 1, 0
|
||||
)
|
||||
self.assertSetupExternal(
|
||||
TestObject(hand, PathThreadMilling.DirectionConventional, 1, 0), "G3", 0, 1
|
||||
)
|
||||
|
||||
def test51(self):
|
||||
"""Verify exteranl left hand thread setup."""
|
||||
|
||||
hand = PathThreadMilling.LeftHand
|
||||
|
||||
self.assertSetupExternal(TestObject(hand, PathThreadMilling.DirectionClimb, 1, 0), "G2", 0, 1)
|
||||
self.assertSetupExternal(TestObject(hand, PathThreadMilling.DirectionConventional, 1, 0), "G3", 1, 0)
|
||||
|
||||
self.assertSetupExternal(
|
||||
TestObject(hand, PathThreadMilling.DirectionClimb, 1, 0), "G2", 0, 1
|
||||
)
|
||||
self.assertSetupExternal(
|
||||
TestObject(hand, PathThreadMilling.DirectionConventional, 1, 0), "G3", 1, 0
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user