Traceable Components¶
Warning
Components with strikethrough()
are in development and not yet supported. PyRayT is still in the alpha stages and more components are being added regularly.
Sources¶
As a forward ray tracer, PyRayT’s rays are generated by sources and traced through the system until terminated. All sources inherit from the Source
base class, which can be used to create custom sources. By default, all rays are propogating along the +X axis, but they can be moved and rotated in world space like any traceable object.
Basic Sources¶
LineOfRays
- A set of rays linearly spaced in one dimensionConeOfRays
- A radially distributed set of rays originating from a point, with a predefined diverging angleWedgeOfRays
- A set of rays angularly distributed in one dimensionCircleOfRays
- A set of parallel rays uniformly distributed about a circular arc.PointOfRays
- A spatically distributed set of rays originating from a point, with a predefined diverging angleGridOfRays
- A set of rays uniformly distributed about an aperture, propogating alonge the +X axis
Additional Sources¶
Lamp
- A randomly generated set of rays, uniformly distributed over an aperture with a Lambertian intensity distribution.StaticLamp
- Identical toLamp
, but uses caching to ensure successive calls togenerate_rays()
generate the sameRaySet
object.ImageSource
- Generates a set of Rays based on the pixel values of an image.
Built in Parts¶
Note
The next to components link to additional resources for the describing the simulated components.
Specifying Apertures¶
All component factory functions accept an aperture
keyword argument. Internally, components are created
from Constructive Solid Geometry operations performed on primitives in the tinygfx package. For example, the object returned by
biconvex_lens()
is the intersection of two spheres and an aperture primitive that sets the lens boundaries.
The aperture argument accepts either a single or tuple of floats, whose sign determines the final aperture.
argument |
argument type |
aperture shape |
CSG primitive |
---|---|---|---|
|
float |
Circle with diameter x |
|
|
Tuple[float, float] |
Rectangle with side lengths y1 and z1 |
|
|
Tuple[float, float] |
Ellipse with diameters y1 and z1 |
Lenses¶
Lens Keyword arguments¶
Any of the following keyword arguments can be passed to a lens function.
material (
TracableMaterial
) - The lens material, defaults to a simple refractive material with n=1.5aperture (specified aperture) - The lenses aperture, defaults to a circular aperture with a diameter of 1
Spherical Lenses¶
biconcave_lens()
plano_concave_lens()
Nonstandard Lenses¶
Mirrors¶
Mirror Keyword arguments¶
material (
TracableMaterial
) - The mirror material. Defaults to a perfect reflectoraperture (specified aperture) - The mirror aperture. Defaults to a circular aperture with a diameter of 1.