MCPcopy Index your code
hub / github.com/CadQuery/cadquery / testPolarLines

Method testPolarLines

tests/test_cadquery.py:2037–2063  ·  view source on GitHub ↗

Draw some polar lines and check expected results

(self)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 12

polarLineMethod · 0.95
WorkplaneClass · 0.85
XYMethod · 0.80
polarLineToMethod · 0.80
closeMethod · 0.45
sizeMethod · 0.45
wiresMethod · 0.45
edgesMethod · 0.45
toTupleMethod · 0.45
positionAtMethod · 0.45
valMethod · 0.45
moveMethod · 0.45

Tested by

no test coverage detected