Example #1
0
                          x=np.array([0, 0, 100e-3]),
                          material=opt_sys.material_library.get_material('fs'),
                          size=50e-3)
slab2.set_rotation(0, 0 * np.pi / 180)
slab3 = oe.OpticalElement(n=1.5,
                          thickness=10e-3,
                          x=np.array([0, 0, 100e-3]),
                          material=opt_sys.material_library.get_material('fs'),
                          size=50e-3)
slab3.set_rotation(0, 0 * np.pi / 180)

screen = oe.ScreenElement(x=np.array([0, 0, 100e-3]))
screen.rotate_element(0, 0 * np.pi / 180)

r1 = rs.Collimated1DSource(num_rays=3,
                           x_dim=10e-3,
                           l=263e-9,
                           color=(0.15, 0.1, 0.75))
theta = 0 * np.pi / 180.0
m = np.array([[1.0, 0.0, 0.0, 0.0], [0.0, +np.cos(theta),
                                     np.sin(theta), 0.0],
              [0.0, -np.sin(theta), np.cos(theta), 0.0], [0.0, 0.0, 0.0, 1.0]])
phi = 0 * np.pi / 180.0
m = np.array([[+np.cos(phi), 0.0, np.sin(phi), 0.0], [0.0, 1.0, 0.0, 0.0],
              [-np.sin(phi), 0.0, np.cos(phi), 0.0], [0.0, 0.0, 0.0, 1.0]])
r1.rays[:, 1, :] = np.dot(m, r1.rays[:, 1, :].transpose()).transpose()

opt_sys.add_element(slab0)
opt_sys.add_element(slab1)
opt_sys.add_element(slab2)
opt_sys.add_element(slab3)
opt_sys.add_element(screen)
Example #2
0
apex = 58 * np.pi / 180
prismMat = optSys.material_library.get_material('sapphire')
prism = oe.PrismElement(x=np.array([0, 0, 50e-3]),
                        n=1.5,
                        apexAngle=apex,
                        sideLength=50e-3,
                        material=prismMat)

prism.set_position(np.array([-10e-3, 0, 200e-3, 1]))

screen = oe.ScreenElement(x=np.array([0, 0, 400e-3]))
screen.rotate_element(0, 0 * np.pi / 180)

r1 = rs.Collimated1DSource(numRays=3,
                           xDim=1e-3,
                           l=263e-9,
                           color=(0.15, 0.1, 0.75))

optSys.add_element(prism)
optSys.add_element(screen)
#optSys.addRaySource(r1)
print "raytracing..."
dev = []

theta_step = 0.1
theta = np.arange(0, 45, theta_step)

prism.rotate_element(0, np.min(theta) * np.pi / 180)
for th in theta:
    prism.rotate_element(0, theta_step * np.pi / 180)
    r1 = rs.Collimated1DSource(numRays=20,
Example #3
0
prism3.rotate_element(0, np.pi - prismAngle)

prism4 = oe.PrismElement(x=np.array(
    [-prismOffset - 8e-3 + prism4Insert, 0, 1200e-3]),
                         n=1.5,
                         apexAngle=65 * np.pi / 180,
                         sideLength=50e-3,
                         material=prismMat)
#prism4.reverseElement()
prism4.rotate_element(0, prismAngle)

screen = oe.ScreenElement(x=np.array([0, 0, 400e-3]))
screen.rotate_element(0, 0 * np.pi / 180)

r1 = rs.Collimated1DSource(numRays=5,
                           xDim=10e-3,
                           l=263e-9,
                           color=(0.15, 0.1, 0.75))
r2 = rs.Collimated1DSource(numRays=5, xDim=10e-3, l=264e-9, color=(0, 0.5, 0))

axRot = devAngle
optSys.add_element(prism)
optSys.rotate_optical_axis_after_element(0, axRot, 0)
optSys.add_element(prism2)
optSys.rotate_optical_axis_after_element(0, -axRot, 1)
optSys.add_element(prism3)
optSys.rotate_optical_axis_after_element(0, -axRot, 2)
optSys.add_element(prism4)
optSys.rotate_optical_axis_after_element(0, axRot, 3)
optSys.add_element(screen)
optSys.add_ray_source(r1)
optSys.add_ray_source(r2)
Example #4
0
                      material=optSys.material_library.get_material('fs'))
lens2.flip_element()
# lens2.rotateElement(0, 47 * np.pi / 180.0)

prism2 = oe.PrismElement(x=np.array([0, 0, 200e-3]),
                         n=1.5,
                         apex_angle=65 * np.pi / 180,
                         side_length=50e-3,
                         material=prismMat)
prism2.rotate_element(0, 23 * np.pi / 180)

screen = oe.ScreenElement(x=np.array([0, 0, 200e-3]))
screen.rotate_element(0, 0 * np.pi / 180)

r1 = rs.Collimated1DSource(num_rays=20,
                           x_dim=10e-3,
                           l=263e-9,
                           color=(0.15, 0.1, 0.75))
r2 = rs.Collimated1DSource(num_rays=20,
                           x_dim=10e-3,
                           l=264e-9,
                           color=(0, 0.5, 0))

# optSys.addElement(slab)
# optSys.rotateOpticalAxisAfterElement(0, -10 * np.pi / 180, 0)
# optSys.addElement(slab2)
optSys.add_element(prism)
optSys.rotate_optical_axis_after_element(0, 42.5 * np.pi / 180, 0)
optSys.add_element(lens)
optSys.add_element(lens2)
optSys.add_element(prism2)
optSys.rotate_optical_axis_after_element(0, 42.5 * np.pi / 180, 3)