Ready to create a custom lens in OpticStudio? Find the help you need here!
- 51 Topics
- 122 Replies
gaussian beam in non sequential mode
I need to simulate a gaussian beam in non sequential mode, which has 850 nm wavelength, 15 degree diveregence angle (half angle) and the beam raduis of 2.563 mm at 10 mm which has the cross section of the beam profile shape as attached below, but when putting this values using the Gaussian source it doesnt give me the same results. By using the skewRaysCircular I cannot get the gaussain beam profile and it just shows me a ring, how can I get a gaussian beam profile in the output?
Simulate 2D diffraction grating using customized diffractive DLL
In OpticStudio, currently we only support one dimensional grating. However, it's not difficult to simulate 2D grating. Here we will show an example using diffractive DLL.You may compile it with the instructions or use the DLL file attached to this article. Before we start, here are some articles for required background knowledge that we will not repeat in this forum post. How diffractive surfaces are modeled in OpticStudio (KBA) How diffraction ray-tracing is calculated (forum post) Custom DLLs in OpticStudio: An overview of user-defined surfaces, objects, and other DLL types (KBA) How to compile a User-Defined DLL (KBA) Let's simply open the attached cpp file and observe how it works.This example is mainly modified from the built-in sample \Documents\Zemax\DLL\Diffractive\diff_samp_1.c To compile the program as C++ code. We package the functions with extern 'C'. In this example, we only want to return diffraction ray direction and its relative intensity. So setting data = 1
Read and parse data from text file in DLL using in C++ way
In this forum post, a sample C++ code to read value from a text file in DLL is shared. This is mainly a supplement to the follwoing knowledge base article. The only difference is we will do the similar thing with C++ code to how how to do this in C++ style. How to read a static data file into a user-defined surface In the attachments, a sample code is attached. This code does the same thing as shown in the following forum post. The difference is the diffraction efficiency data is read from a text file. Simulate 2D diffraction grating using customized diffractive DLL We will explain line by line in below. The first thing to do is to define a global variable, which is declared outside of all the functions. As discussed here, during ray-tracing in OpticStudio, the DLL will be called several times. For the global variable, the inside value is unchanged and the DLL can always see the same data in different thread. Our plan is to read data from text file and save it in this global va
OpticStudio grating tools beta function update history
This forum post is a place to collect update history of diffractive tools beta functions, which includes all RCWA DLLs (and visualization API), polygon DLL, and Zemax Grating Data (ZGD) DLL. Content:1. Overview2. Resources3. Change history OverviewCurrently in OpticStudio, we are adding some useful DLLs to enhance the ability of fully simualting gratings. They allow OpticStudio to consider the efficiency when rays pass through diffractive optical elements (DOE), such like 1D/2D gratings, binary optics, or volume holograms. These extensions can be found in OpticStudio installations.These tools improve frequently based on users’ feedback. We decide to provide functions with DLL so it can be updaetd fast upon users' request. Between each OpticStudio public releases, there might be several minor updates and bug fixes. This forum post is a place for changes history.Note all tools provided here are only available with OpticStudio Premium Subscription. If users are interested in these functio
How to simulate for Grid Wire Polarizer
In this post, it’s introduced how to simulate realistic grid wire polarizer with RCWA function that comes with OpticStudio 20.2. (Source: https://www.thorlabs.com/newgrouppage9.cfm?objectgroup_id=5510) Note there are many different types of polarizer For polarizer based on birefringent crystal, check the following article: How to design birefringent polarizers For polarizer based on coating, there is no an article specific to introduction, but users can refer to the following article to know how to set up a coating and assign to object for beam splitting. How to model a dichroic beam splitter Then it’s also worth to note the existence of a build-in ideal coating “PASS_P”. This coating allows P polarization to pass and reflect light with S polarization. Note the coating method can only work for obliquely incident beam. Usually this kind of polarizer is made as a cube or a plate oblique placed in the system. More information can be found in this forum post: 'Pass_P' coating
SkewRaysGaussian: need DLL supporting general astigmatism
I was pleased to see the new NSC Source DLL 'SkewRaysCircular.dll' added in the May 19 release (OpticStudio 20.2). We have immediate use for it in modeling our systems. It was inspired by the similar (sequential) User Defined Surface DLLs discussed in Paul Colbourne's webinar and KnowledgeBase Article KA-01772, which allows optimization of generally astigmatic Gaussian beams in Sequential mode. But I was disappointed to see that the new Non-Sequential Source DLL only models CIRCULAR Gaussian beams with no astigmatism, unlike the Sequential capabilities that were supplied by Dr. Colbourne, which accommodate general astigmatism! I suggest updating and replacing SkewRaysCircular.dll with a new, more general, Source DLL, renamed appropriately, e.g., SkewRaysGaussianXY.dll , that DOES support general astigmatism. This would seem simple enough to implement starting from the existing SkewRaysCircular.dll: add new pairs of parameters for WaistX, WaistY, (and/or SIzeX, Siz
Gaussian XY scattering
We have some asymmetric scatterers in the lab that I would like to model in zemax. They have different gaussian scattering properties in horizontal and vertical direction. So i tried to use the Gaussian XY DLL to model it, but it behaves weired. A ray hitting the surface perpendicular is scattered as intended, but rays under even small angles are changing it completely. The scatter pattern for a ray with 1° in x-direction is twisted 90° to a ray under 1° in y-direction. Is there a mistake or do I something wrong? I have attached an example file. Best Steffen
How to pass more parameters to a User-Defined Surface DLL?
A user-defined surface DLL will retrieve information from OpticStudio via the FIXED_DATA5 structure defined in the header file. An example of the header file can be found under '\Zemax\DLL\Surfaces\usersurf.h'. To access the surface parameters, the DLL reads the variable param in the FIXED_DATA5 structure: If we need to pass more parameters to the DLL, one way can be to use the datasurf_numvalues and datasurf_values. To use this, a 'Data' surface has to be used. Below I have taken a screenshot when debugging a user-defined surface: I hope this helps but do not hesitate to share your comments. Sandrine
Source Two Angle DLL
Hi there, I am trying to write a source DLL file to use in OpticStudio, which is based on the built-in source “Source Two Angle”. It would be great if I could use this as a starting point. Is the (cpp) code available for this source? Or is there something similar I could start with? Thank you!
Diffraction orders of the DMD
Hello everyone, I am trying to design Digital Micromirror Device(DMD) in SEQ using 'us_mems.dll'. We know that the DMD behaves as a blazed grating, and also it has diffraction pattern, what I have seen during experiments also. I am wondering how can I simulate the diffraction orders of DMD in ZEMAX. Thanks in advance. Ast
Some RCWA DLLs cannot be found in OpticStudio 21.2.1
Hi, I was reading Michael Cheng's article 'OpticStudio grating tools beta function update history' and have some questions. This article mentioned 'download link' many times, but I did not see these corresponding links. And I did not see some DLLs mentioned in this article in OpticStudio 21.2.1, for example: 'Polygon grating DLL', 'A new DLL is created for reading pre-calculated efficiency data for 1D/2D gratings'. I want to know where I can find these DLLs and their usage. Thanks & Regards, Dongdong
Diffraction Orders in NS components
Hello, I have sequential rays that enter a non-sequential component. In this element there are two sets of dffraction gratings helps rays to couple into the the medium and extract from the medium for analysis. However, the rays I sent only diffract along the set primary diffraction order. Can Optistudio simultaneously trace multiple diffraction orders NS components? Thanks,
Mie scattering from a single water droplet
Greetings,I am attempting to model mie scattering for a single water droplet illuminated by a laser beam (monochromatic, collimated, and planar) and see the 'rings' on the detector varying with particle size. There is already a similar post: but no solution was reached.My current setup features a 'source ellipse' as the light source and a single 'Sphere' object as the water droplet with DLL Defined Scattering enabled under the Volume Physics tab. This much I have learned from the Zemax knowledgebase article entitled 'How to simulate atmospheric scattering using a Mie model'. My question now is what values for density and mean path should I enter in the MIE.DLL section under the Volume Physics tab?Suppose I start with a 10 micron diameter water droplet and I place the detector 500um (0.5mm) away from it, what density and mean path values correspond? Or is there a better approach?Thank you in advance.
Scattering in Zemax
Hi I have a question about the Henyey Greenstein model in Zemax. I am now using the Henyey-Greenstein (HG) model in combination with the wavelength shift to simulate the Raman scattering. Because the mean free path is wavelength-dependent in the same tissue, my question is that, in the multiple scattering, if the input photon is altered in wavelength, will its mean free path be changed too in the next scattering event? From the HG source code, it seems like the mean free path is a constant to all wavelengths. Furthermore, I also found from your HG source code that you didn't really consider the light absorption while in scattering events, right? Thanks in advance!
Diffraction grating DLLs don't work
I wanted to try out the new diffraction grating DLLs.  Following the example in the knowledge base article, when I get to the point of selecting one of the DLLs I get an error message "Unable to load 'UserParamNames' function from DLL".  The only DLL that seems to work is diff_samp_1.DLL
Compile a User-Defined Surface
Hi everyone, I'm trying to insert a surface using a DLL file, but it looks like my OpticStudio is not recognize the file. My actions were putting the file in C:\ProgramData\Zemax\DLL\Surfaces (where all the other user define functions located) and then search for this file in the lens data editor. (I followed the instruction from https://my.zemax.com/en-US/Knowledge-Base/kb-article/?ka=KA-01787. Without making any changes) Looking over the list, I don't see my file. What could be the reason for that? What is the right way to use user-defined function/ DLL functions? Thanks a lot! Marta
DLL Non-Sequential User Defined Object data structure
For the User defined object DLL, Zemax passes a variable “data” to the function UserObjectDefinition. However, I have not been able to find any documentation on what each element of this array is. The examples provide some of the parameters (for example the CoatingSample.dll file gives the first 15 parameters and a few others up to parameter 34, see the code below from the example). Where can I find documentation to understand what other parameters I have access to from this data structure? The data ZEMAX sends is formatted as follows: data, data, data = x, y, z data, data, data = l, m, n data = coat group number data, data, data = normal nx, ny, nz data, data = current and next index of refraction data = cosine of normal incidence angle data = wavelength in µm data = zero flag. Set this to 1.0 to indicate the DLL computes the coating data, otherwise, ZEMAX will compute u
How to make a source in non-sequential that looks like a letter?
I’m interested in modeling an OLED display that’s displaying the letter P. The brute way to do this would be a series of lambertian point sources that form that shape. Is there a better way? Maybe with a dll or a CAD object? Thanks!Donna
OpticStudio can not load DLLs
I tried to use the original Gaussian.cpp in Visual Studio 2019 to create a dll project. I created a default dll project and copied the Gaussian.cpp and tried to build the file. The header file is left empty. The build was successful but when I tried to load into Zemax, it gives error saying cannot load DLL as in the attachment.
How to setup Visual Studio Code (or other open source IDE) to compile a DLL for Zemax
As stated in the title I need to compile my own DLLs for my system. I don't have access to Visual studio or Visual Studio community, and in general, I try to work as much as possible with open source solutions. Can somebody help me to set up an environment to compile a DLL with free and open source IDE and compiler? Ideally Visual Studio Code. I'm working on Windows 10 x64.
substitute for surface apodization in basic version
Hello I have a license for basic version of OpticStudio. I need to apply an apodization filter to a surface in order to program the transmission to be a Gaussian function. But it seems that the 'filter' type of surface is only available in the premium version. Is there any substitute for this function that I can use? Thank you.
How to analyze stray light in hologram imaging system
Hello, This post would just like to share how you could find stray light with OpticStudio hologram model. In the following knowledge base article, Simulating diffraction efficiency of a volume holographic grating using Kogelnik’s method we have shared an non-sequential example as below. It's not obvious, but here are actually some stray light in this example. To find them, we can just increase the Contrast Enhancement in Detector Viewer as shown below. Then you can find those 0th order ghost!
Already have an account? Login
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.