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

Function test_edge_params

tests/test_shapes.py:130–141  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

128
129
130def test_edge_params():
131
132 e = spline([(0, 0), (1, 0), (1, 1), (2, 0), (2, -1)], periodic=True)
133 N = 5
134
135 pts_orig = e.sample(N)[0]
136 pts = [pt + Vector(0, 0, 1e-1) for pt in pts_orig]
137
138 ps = e.params(pts)
139
140 for i in range(N):
141 assert (e.positionAt(ps[i], mode="parameter") - pts_orig[i]).Length == approx(0)
142
143
144def test_edge_tangents():

Callers

nothing calls this directly

Calls 5

splineFunction · 0.90
VectorClass · 0.85
sampleMethod · 0.80
paramsMethod · 0.45
positionAtMethod · 0.45

Tested by

no test coverage detected