MCPcopy Create free account
hub / github.com/danieljfarrell/pvtrace / test_intersection_coordinate_system

Method test_intersection_coordinate_system

tests/test_scene.py:73–89  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

71 assert np.allclose(points, ((0.0, 0.0, 0.0), (2.0, 0.0, 0.0)))
72
73 def test_intersection_coordinate_system(self):
74 root = Node(name="Root", geometry=Sphere(radius=10.0))
75 a = Node(name="A", parent=root, geometry=Sphere(radius=1.0))
76 a.translate((1.0, 0.0, 0.0))
77 scene = Scene(root)
78 initial_ray = Ray(
79 position=(-2.0, 0.0, 0.0),
80 direction=(1.0, 0.0, 0.0),
81 wavelength=None,
82 is_alive=True,
83 )
84 scene_intersections = scene.intersections(
85 initial_ray.position,
86 initial_ray.direction
87 )
88 a_intersections = tuple(map(lambda x: x.to(root), scene_intersections))
89 assert scene_intersections == a_intersections
90
91if __name__ == '__main__':
92 pass

Callers

nothing calls this directly

Calls 7

intersectionsMethod · 0.95
NodeClass · 0.90
SphereClass · 0.90
SceneClass · 0.90
RayClass · 0.90
translateMethod · 0.80
toMethod · 0.80

Tested by

no test coverage detected