Like testSplineWithScaleTrue, but verifies the tangent vector is different when scale=False. The interpolation points and tangent vectors are the same in `testSplineWithScaleTrue`, and `testSplineWithScaleFalse`. A test point is rendered at the same paramete
(self)
| 806 | self.assertAlmostEqual((test_point - expected_test_point).Length, 0) |
| 807 | |
| 808 | def testSplineWithScaleFalse(self): |
| 809 | """ |
| 810 | Like testSplineWithScaleTrue, but verifies the tangent vector is |
| 811 | different when scale=False. |
| 812 | |
| 813 | The interpolation points and tangent vectors are the same in |
| 814 | `testSplineWithScaleTrue`, and `testSplineWithScaleFalse`. A test |
| 815 | point is rendered at the same parameter value in both cases, but its |
| 816 | coordinates are different in each case. |
| 817 | """ |
| 818 | points = [(0, 0), (1, 1), (2, 0), (1, -1)] |
| 819 | tangents = [(0, 1), (1, 0), (0, -1), (-1, 0)] |
| 820 | parameters = range(len(points)) |
| 821 | |
| 822 | spline = ( |
| 823 | Workplane("XY") |
| 824 | .spline(points, tangents=tangents, parameters=parameters, scale=False) |
| 825 | .consolidateWires() |
| 826 | ) |
| 827 | |
| 828 | test_point = spline.edges().val().positionAt(0.5, mode="parameter") |
| 829 | expected_test_point = Vector(0.375, 0.625, 0.0) |
| 830 | |
| 831 | self.assertAlmostEqual((test_point - expected_test_point).Length, 0) |
| 832 | |
| 833 | def testSplineTangentMagnitudeBelowToleranceThrows(self): |
| 834 | import OCP |
nothing calls this directly
no test coverage detected