Refraction through multiple surfaces with different IOR not working

Hi, using the mosquito plugin, I’m trying to simulate refraction of light rays through multiple surfaces, each with a different refraction index (IOR). I want to calculate the effect of a glass lens placed on a plastic panel.

But whatever I try (grafting, duplicating list number), the rays don’t go refract well. Or there will be double the amount of refracted lines, calculate for both IOR values.

Any suggestions how to best approach this?

I addition, can someone explain what the effect is for toggle for ‘solid’. It states on the website toggling this will treat the space between any two surfaces as the same medium. But when you have 2 planar surfaces with same IOR above each other, you would asume this to be a solid, but when you toggle ‘solid’ the refracted lines are different between to states (34.1 KB)

Here visualised what i cannot understand about the solid vs non solid toggle, hope some one can explain. Download of mosquito plugin for Refract building block (7.0 KB)

Reply by the developer of Mosquito (Carson)

Blockquote 1. It would seem the plugin is not handling multiple refractive materials when the mediums are different. For this you will need to calculate the first rays and pass them to another instance of the plugin to calculate the resulting ray passing through a 2nd medium. ie. Air → Glass → Diamond

Blockquote 2. You need to specify both the first and 2nd medium. Even if its air. So in the attached GH screen shot you will see that for the first instance of the plugin I pass in ‘1.000293’ for air into Ni and then ‘1.52’ for glass into ‘Nr’……And, because the ray is traveling through a 2nd medium (diamond) after the glass, we then pass in ‘1.52’ for Ni (Glass) and ‘2.419’ for Nr (Diamond).