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

Function test_der

tests/test_nurbs.py:134–148  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

132
133
134def test_der():
135
136 knots = np.array([0, 0, 0, 0, 0.25, 0.5, 0.75, 1, 1, 1, 1])
137 params = np.linspace(0, 1, 100)
138 order = 3
139
140 out_der = np.zeros((order + 1, order + 1))
141 out = np.zeros(order + 1)
142
143 for p in params:
144 nbBasisDer(nbFindSpan(p, order, knots), p, order, order - 1, knots, out_der)
145 nbBasis(nbFindSpan(p, order, knots), p, order, knots, out)
146
147 # sanity check
148 assert np.allclose(out_der[0, :], out)
149
150
151def test_periodic_curve():

Callers

nothing calls this directly

Calls 3

nbBasisDerFunction · 0.90
nbFindSpanFunction · 0.90
nbBasisFunction · 0.90

Tested by

no test coverage detected