Tests specifying B-spline tangents, besides the start point and end point tangents.
(self)
| 723 | self.assertAlmostEqual(path2.val().tangentAt(0).z, 0) |
| 724 | |
| 725 | def testSplineWithMultipleTangents(self): |
| 726 | """ |
| 727 | Tests specifying B-spline tangents, besides the start point and end |
| 728 | point tangents. |
| 729 | """ |
| 730 | |
| 731 | points = [(0, 0), (1, 1), (2, 0), (1, -1)] |
| 732 | tangents = [(0, 1), (1, 0), (0, -1), (-1, 0)] |
| 733 | parameters = range(len(points)) |
| 734 | |
| 735 | spline = ( |
| 736 | Workplane("XY") |
| 737 | .spline(points, tangents=tangents, parameters=parameters) |
| 738 | .consolidateWires() |
| 739 | ) |
| 740 | |
| 741 | test_point = spline.edges().val().positionAt(2.5, mode="parameter") |
| 742 | expected_test_point = Vector(1.875, -0.625, 0.0) |
| 743 | |
| 744 | self.assertAlmostEqual((test_point - expected_test_point).Length, 0) |
| 745 | |
| 746 | def testSplineWithSpecifiedAndUnspecifiedTangents(self): |
| 747 | points = [(0, 0), (1, 1), (2, 0), (1, -1)] |
nothing calls this directly
no test coverage detected