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

Method reflect

pvtrace/material/surface.py:242–256  ·  view source on GitHub ↗

Returns ray which is reflected from the interface.

(self, ray, geometry, container, adjacent)

Source from the content-addressed store, hash-verified

240 return gamma < r
241
242 def reflect(self, ray, geometry, container, adjacent):
243 """ Returns ray which is reflected from the interface.
244 """
245 direction = self.delegate.reflected_direction(
246 self, ray, geometry, container, adjacent
247 )
248 if not isinstance(direction, tuple):
249 raise ValueError(
250 "Delegate method `reflected_direction` should return a tuple."
251 )
252 if len(direction) != 3:
253 raise ValueError(
254 "Delegate method `reflected_direction` should return a tuple of length 3."
255 )
256 return replace(ray, direction=direction)
257
258 def transmit(self, ray, geometry, container, adjacent):
259 """ Returns ray which is transmitted from the interface.

Callers 1

followFunction · 0.45

Calls 1

reflected_directionMethod · 0.45

Tested by

no test coverage detected