[1]:
from diffractio import degrees, np, um
from diffractio.scalar_masks_XY import Scalar_mask_XY
from diffractio.scalar_masks_XYZ import Scalar_mask_XYZ
number of processors: 8

3.5. Sphere

[2]:
length = 100 * um
numdataX = 128
numdataZ = 128


x0 = np.linspace(-length / 2, length / 2, numdataX)
y0 = np.linspace(-length / 2, length / 2, numdataX)
z0 = np.linspace(-length / 2, length / 2, numdataX)
wavelength = 0.55 * um

uxyz = Scalar_mask_XYZ(
    x=x0, y=y0, z=z0, wavelength=wavelength, n_background=1., info='')
uxyz.sphere(
    r0=(0 * um, 0 * um, 0 * um),
    radius=(50 * um, 50 * um, 50 * um),
    refraction_index=2,
    angles=(0 * degrees, 0 * degrees, 45 * degrees))
uxyz.draw_refraction_index()

close the window to continue

title

3.6. Square

[3]:
length = 100 * um
numdataX = 128
numdataZ = 128


x0 = np.linspace(-length / 2, length / 2, numdataX)
y0 = np.linspace(-length / 2, length / 2, numdataX)
z0 = np.linspace(-length / 2, length / 2, numdataX)
wavelength = 0.55 * um


uxyz = Scalar_mask_XYZ(
    x=x0, y=y0, z=z0, wavelength=wavelength, n_background=1., info='')
uxyz.square(
    r0=(0 * um, 0 * um, 0 * um),
    length=(50 * um, 50 * um, 50 * um),
    refraction_index=2,
    angles=None,
    rotation_point=None)
uxyz.draw_refraction_index()

close the window to continue

title

3.7. Cylinder

[4]:
length = 100 * um
numdataX = 128
numdataZ = 128

longitud = 50 * um

x0 = np.linspace(-length / 2, length / 2, numdataX)
y0 = np.linspace(-length / 2, length / 2, numdataX)
z0 = np.linspace(-longitud, longitud, numdataZ)
wavelength = 0.55 * um


uxyz = Scalar_mask_XYZ(
    x=x0, y=y0, z=z0, wavelength=wavelength, n_background=1., info='')
uxyz.cylinder(
                 r0=(0 * um, 0 * um, 0 * um),
                 radius=(25 * um, 25 * um),
                 length=25 * um,
                 refraction_index=2,
                 eje=(1, 1, 1),
                 angle=45 * degrees)
uxyz.draw_refraction_index()
close the window to continue

title

[ ]: