MCPcopy
hub / github.com/CadQuery/cadquery / test_edge_paramAt

Function test_edge_paramAt

tests/test_shapes.py:42–73  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

40
41
42def test_edge_paramAt():
43
44 # paramAt for a segment
45 e = segment((0, 0), (0, 1))
46
47 p1 = e.paramAt(Vector(0, 0))
48 p2 = e.paramAt(Vector(-1, 0))
49 p3 = e.paramAt(Vector(0, 1))
50
51 assert p1 == approx(p2)
52 assert p1 == approx(0)
53 assert p3 == approx(e.paramAt(1))
54
55 # paramAt for a simple wire
56 w1 = wire(e)
57
58 p4 = w1.paramAt(Vector(0, 0))
59 p5 = w1.paramAt(Vector(0, 1))
60
61 assert p4 == approx(p1)
62 assert p5 == approx(p3)
63
64 # paramAt for a complex wire
65 w2 = polyline((0, 0), (0, 1), (1, 1))
66
67 p6 = w2.paramAt(Vector(0, 0))
68 p7 = w2.paramAt(Vector(0, 1))
69 p8 = w2.paramAt(Vector(0.1, 0.1))
70
71 assert p6 == approx(w2.paramAt(0))
72 assert p7 == approx(w2.paramAt(0.5))
73 assert p8 == approx(w2.paramAt(0.1 / 2))
74
75
76def test_face_paramAt():

Callers

nothing calls this directly

Calls 5

segmentFunction · 0.90
wireFunction · 0.90
polylineFunction · 0.90
VectorClass · 0.85
paramAtMethod · 0.45

Tested by

no test coverage detected