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

Function test_surface_tangents

tests/test_nurbs.py:506–520  ·  view source on GitHub ↗
(face, request)

Source from the content-addressed store, hash-verified

504
505@mark.parametrize("face", FACES)
506def test_surface_tangents(face, request):
507
508 f = request.getfixturevalue(face)
509 surf = Surface.fromFace(f)
510
511 for u in PARAMS:
512 for v in PARAMS:
513 dun, dvn, p = f.tangentAt(u, v)
514 der = surf.der(u, v, 1).squeeze()
515 du = der[1, 0, :]
516 dv = der[0, 1, :]
517
518 assert np.allclose(dun.toTuple(), du / np.linalg.norm(du))
519 assert np.allclose(dvn.toTuple(), dv / np.linalg.norm(dv))
520 assert np.allclose(p.toTuple(), der[0, 0, :])
521
522
523@mark.parametrize("isoparam", PARAMS)

Callers

nothing calls this directly

Calls 4

fromFaceMethod · 0.80
tangentAtMethod · 0.45
derMethod · 0.45
toTupleMethod · 0.45

Tested by

no test coverage detected