Closed Mateasek closed 5 years ago
Hi Matej,
Are you sure this functionality doesn't exist already? The _generate_rays() function in all the classes is based on a set of utility functions in the core math classes. Maybe they aren't documented well enough with examples.
The respective utility functions we use are located here: https://github.com/raysect/source/blob/master/raysect/core/math/sampler/surface3d.pyx https://github.com/raysect/source/blob/master/raysect/core/math/sampler/solidangle.pyx
And there is some documentation on how to use them in the API docs: https://raysect.github.io/documentation/api_reference/core/random.html#raysect.core.math.sampler.surface3d.SurfaceSampler3D https://raysect.github.io/documentation/api_reference/core/random.html#raysect.core.math.sampler.solidangle.SolidAngleSampler
You should be able to use them by initialising the class with the desired properties and then simply calling the class with the number of samples you want.
Do you still think some functionality is missing? Maybe I just need to document it better?
Hi Matt,
thanks for the answer, that is actually all I needed. I was trying to get a random vector and origin through FIbreOptic object, which was impossible. This is exactly what I need. The documentation is sufficient, it is my searching and python skills which need to be improved :-D
I think we can close this.
It would be nice to have a function which would generate random direction (Vector3D) and origin (Point3D) of a ray from an observer. It could work nicely together with LoggingRay class.
It could be close to _generate_rays function of FIbreOptic class: https://github.com/raysect/source/blob/690b7440caa7087b855e2726fb1f63e02c22d668/raysect/optical/observer/nonimaging/fibreoptic.pyx#L138-L161
something like: