How to use the raytracing.Space function in raytracing

To help you get started, we’ve selected a few raytracing examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DCC-Lab / RayTracing / examples / argsExamples / example14.py View on Github external
obj = Objective(f=10, NA=0.8, focusToFocusLength=60, backAperture=18, workingDistance=2, label="Objective")
print("Focal distances: ", obj.focalDistances())
print("Position of PP1 and PP2: ", obj.principalPlanePositions(z=0))
print("Focal spots positions: ", obj.focusPositions(z=0))
print("Distance between entrance and exit planes: ", obj.L)

path = ImagingPath()
path.fanAngle = 0.0
path.fanNumber = 1
path.rayNumber = 15
path.objectHeight = 10.0
path.label = "Demo #14 Path with generic objective"
path.append(Space(180))
path.append(obj)
path.append(Space(10))
path.display()
github DCC-Lab / RayTracing / examples / argsExamples / example18.py View on Github external
'''


path = LaserPath()
path.label = "Demo #18: Laser beam and vendor lenses"
path.append(Space(d=50))
path.append(thorlabs.AC254_050_A())
path.append(Space(d=50))
path.append(thorlabs.AC254_050_A())
path.append(Space(d=150))
path.append(eo.PN_33_921())
path.append(Space(d=50))
path.append(eo.PN_88_593())
path.append(Space(d=180))
path.append(olympus.LUMPlanFL40X())
path.append(Space(d=10))
path.display()
github DCC-Lab / RayTracing / examples / argsExamples / example9.py View on Github external
from raytracing import ImagingPath, Space, Lens, Aperture

'''
    Demo #9 - Infinite telecentric 4f telescope
'''


path = ImagingPath()
path.label = "Demo #9: Infinite telecentric 4f telescope"
path.append(Space(d=5))
path.append(Lens(f=5))
path.append(Space(d=10))
path.append(Lens(f=5))
path.append(Space(d=5))
path.display()
github DCC-Lab / RayTracing / examples / argsExamples / example11.py View on Github external
from raytracing import ImagingPath, Space, ThickLens

'''
Demo #11 - Thick diverging lens
'''


path = ImagingPath()
path.label = "Demo #11: Thick diverging lens"
path.objectHeight = 20
path.append(Space(d=50))
path.append(ThickLens(R1=-20, R2=20, n=1.55, thickness=10, diameter=25, label='Lens'))
path.append(Space(d=50))
path.display()
github DCC-Lab / RayTracing / examples / argsExamples / example3.py View on Github external
from raytracing import ImagingPath, Space, Lens

'''Demo #3 - A finite lens
   An object at z=0 (front edge) is used with default properties (see Demo #1). Notice the aperture stop (AS)
   identified at the lens which blocks the cone of light. There is no field stop to restrict the field of view,
   which is why we must use the default object and cannot restrict the field of view. Notice how the default
   rays are blocked.'''


path = ImagingPath()
path.label = "Demo #3: Finite lens"
path.append(Space(d=10))
path.append(Lens(f=5, diameter=2.5))
path.append(Space(d=3))
path.append(Space(d=17))
path.display()
github DCC-Lab / RayTracing / examples / argsExamples / example8.py View on Github external
from raytracing import ImagingPath, Space, Lens, Aperture


'''
    Demo #8 - Virtual image at -2f with object at f/2
'''


path = ImagingPath()
path.label = "Demo #8: Virtual image at -2f with object at f/2"
path.append(Space(d=2.5))
path.append(Lens(f=5))
path.append(Space(d=10))
path.display()
github DCC-Lab / RayTracing / examples / argsExamples / example12.py View on Github external
from raytracing import ImagingPath, Space, DielectricInterface

'''
Demo #12 - Thick diverging lens built from individual elements
'''


path = ImagingPath()
path.label = "Demo #12: Thick diverging lens built from individual elements"
path.objectHeight = 20
path.append(Space(d=50))
path.append(DielectricInterface(R=-20, n1=1.0, n2=1.55, diameter=25, label='Front'))
path.append(Space(d=10, diameter=25, label='Lens'))
path.append(DielectricInterface(R=20, n1=1.55, n2=1.0, diameter=25, label='Back'))
path.append(Space(d=50))
path.display()
github DCC-Lab / RayTracing / examples / argsExamples / example17.py View on Github external
'''
Demo #17 - Vendor Lenses
'''


path = ImagingPath()
path.label = "Demo #17: Vendor Lenses"
path.append(Space(d=50))
path.append(thorlabs.AC254_050_A())
path.append(Space(d=50))
path.append(thorlabs.AC254_050_A())
path.append(Space(d=150))
path.append(eo.PN_33_921())
path.append(Space(d=50))
path.append(eo.PN_88_593())
path.append(Space(180))
path.append(olympus.LUMPlanFL40X())
path.append(Space(10))
path.display()
github DCC-Lab / RayTracing / examples / argsExamples / example17.py View on Github external
'''


path = ImagingPath()
path.label = "Demo #17: Vendor Lenses"
path.append(Space(d=50))
path.append(thorlabs.AC254_050_A())
path.append(Space(d=50))
path.append(thorlabs.AC254_050_A())
path.append(Space(d=150))
path.append(eo.PN_33_921())
path.append(Space(d=50))
path.append(eo.PN_88_593())
path.append(Space(180))
path.append(olympus.LUMPlanFL40X())
path.append(Space(10))
path.display()
github DCC-Lab / RayTracing / examples / argsExamples / example1.py View on Github external
from raytracing import ImagingPath, Space, Lens

'''Demo #1 - An object at z=0 (front edge) is used. It is shown in blue. The image (or any intermediate images) are shown in red.\n\
This will use the default objectHeight and fanAngle but they can be changed with:
path.objectHeight = 1.0
path.fanAngle = 0.5
path.fanNumber = 5
path.rayNumber = 3'''


path = ImagingPath()
path.label = "Demo #1: lens f = 5cm, infinite diameter"
path.append(Space(d=10))
path.append(Lens(f=5))
path.append(Space(d=10))
path.display()

raytracing

Simple optical ray tracing library to validate the design of an optical system (lenses positions and sizes, focal lengths, aperture and field stops). Support for Monte Carlo raytracing to estimate transmission efficiency and powers, limited but functional Zemax file loader for lenses, several material dispersion curves included for chromatic aberrations all coming from http://refractiveindex.info

MIT
Latest version published 3 months ago

Package Health Score

64 / 100
Full package analysis