Skip to main content

Hello, I'm a student studying optics. I want to measure the optical characteristics by bringing the lens surface file made of matlab to zemax. But I don't know how to use zos-api even if I watch YouTube. So I ask for help from the forum.
The solution I thought about is to extract 3D objects from Matlab and put them in zemax, and I wonder if anyone has actually done it.

my ultimate goal is to engrave the image of the attached file on the surface of the lens.

this is matlab chord

clc
clear all
clf

% line space
global mm um nm;
mm = 1e-3;
um = mm * mm;
nm = um * mm;

pp = 2 * um;  % pixel pitch
res = 1024;
wvl = 550 * nm;

% transmission function
T1 = @(F, angles) exp(1j * F .* angles);
T2 = @(F, angles) exp(-1j * F .* angles);

% equation 5
T_parab =@(theta) exp(1j * theta * round(a * R.^2));


%function y = moire(theta, pyi)
global mm um nm;

% moire coefficent
a = 3.12 * 1e+7;  

% grid setup
x = -pp * res/2 + pp/2 : pp : pp*res/2 -pp/2;
y = x;
[X, Y] = meshgrid(x, y);

r = sqrt(X.^2 + Y.^2);
phy_range = atan((X./Y))+0.5*pi;
phy_range(res/2+1:res, :) = phy_range(res/2+1:res, :) - pi;


Moire_1 = exp(1j * round(a *(X.^2 + Y.^2)) .* phy_range);
subplot(2,3,1);
imshow(angle(Moire_1), []);
axis on;
title('MOIRE 1st')

    
for rotate_theta=0: 10 : 100
    
    %2nd moire pattern
    Moire_2 = imrotate(conj(Moire_1), rotate_theta, 'crop');  
    subplot(2, 3, 2);
    imshow(angle(Moire_2), []);
    axis on;
    title('MOIRE 2nd',num2str(rotate_theta))

    %Result of total lens
    result=angle(Moire_1.*(Moire_2));
    subplot(2, 3, 3);
    imshow(angle(result), []);
    axis on;
    title('result', num2str(rotate_theta))  
    pause(0.2);
    
    subplot (2,3,4)
    mesh(angle(Moire_1))
    title ('Moire_1 mesh', [])
    
    subplot (2,3,5)
    mesh(angle(Moire_2))
    title ('Moire_2 mesh', num2str(rotate_theta))
    
    subplot (2,3,6)
    mesh(angle(result))
    title ('result mesh', num2str(rotate_theta))
%     print(sprintf('Moire %s.jpg',num2str(rotate_theta)))

end
 

targetsufimage.png
Be the first to reply!