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

Method test_intersection

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

Source from the content-addressed store, hash-verified

12class TestScene:
13
14 def test_intersection(self):
15 root = Node(name='Root')
16 a = Node(name="A", parent=root)
17 b = Node(name="B", parent=a)
18 b.geometry = Sphere(radius=1.0)
19 a.translate((1.0, 0.0, 0.0))
20 loc = (-2.0, 0.0, 0.0)
21 vec = (1.0, 0.0, 0.0)
22 scene = Scene(root=root)
23 intersections = scene.intersections(loc, vec)
24 points = tuple([x.point for x in intersections])
25 # In frame of a everything is shifed 1 along x
26 assert points == ((0.0, 0.0, 0.0), (2.0, 0.0, 0.0))
27
28 def test_intersection_with_rotation_around_x(self):
29 root = Node(name='Root')

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected