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

Method emit

pvtrace/scene/node.py:141–166  ·  view source on GitHub ↗

Generator of rays using the node's light object. Parameters ---------- num_rays : int of None The maximum number of rays this light source will generate. If set to None then the light will generate until manually terminated.

(self, num_rays=None)

Source from the content-addressed store, hash-verified

139 return all_intersections
140
141 def emit(self, num_rays=None) -> Iterator[Ray]:
142 """ Generator of rays using the node's light object.
143
144 Parameters
145 ----------
146 num_rays : int of None
147 The maximum number of rays this light source will generate. If set to
148 None then the light will generate until manually terminated.
149
150 to_world: Bool
151 Represent the ray in the world's coordinate frame.
152
153 Returns
154 -------
155 ray : Ray
156 A ray emitted from the light source.
157
158 Raises
159 ------
160 AppError
161 If the node does not have an attached light object.
162 """
163 if self.light is None:
164 raise AppError("Not a lighting node.")
165 for ray in self.light.emit(num_rays=num_rays):
166 yield ray
167
168
169if __name__ == "__main__":

Callers 6

followFunction · 0.45
simulateMethod · 0.45
hello_world.pyFile · 0.45
hello_box.pyFile · 0.45
cylinder.pyFile · 0.45

Calls 1

AppErrorClass · 0.90

Tested by

no test coverage detected