Draw some polar lines and check expected results
(self)
| 2035 | assert a3.edges().first().val().Length() == a4.edges().first().val().Length() |
| 2036 | |
| 2037 | def testPolarLines(self): |
| 2038 | """ |
| 2039 | Draw some polar lines and check expected results |
| 2040 | """ |
| 2041 | |
| 2042 | # Test the PolarLine* functions |
| 2043 | s = Workplane(Plane.XY()) |
| 2044 | r = ( |
| 2045 | s.polarLine(10, 45) |
| 2046 | .polarLineTo(10, -45) |
| 2047 | .polarLine(10, -180) |
| 2048 | .polarLine(-10, -90) |
| 2049 | .close() |
| 2050 | ) |
| 2051 | |
| 2052 | # a single wire, 5 edges |
| 2053 | self.assertEqual(1, r.wires().size()) |
| 2054 | self.assertEqual(5, r.wires().edges().size()) |
| 2055 | |
| 2056 | r = Workplane().polarLineTo(1, 20) |
| 2057 | assert r.val().positionAt(1).toTuple() == approx( |
| 2058 | (0.9396926207859084, 0.3420201433256687, 0.0) |
| 2059 | ) |
| 2060 | r = Workplane().move(1, 1).polarLine(1, 20) |
| 2061 | assert r.val().positionAt(1).toTuple() == approx( |
| 2062 | (1.9396926207859084, 1.3420201433256687, 0.0) |
| 2063 | ) |
| 2064 | |
| 2065 | def testLargestDimension(self): |
| 2066 | """ |
nothing calls this directly
no test coverage detected