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)
| 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 | |
| 169 | if __name__ == "__main__": |
no test coverage detected