qpv-research-group / rayflare

Open-source, integrated optical modelling of complex stacks
Other
31 stars 11 forks source link

What's the "unit" of "size" in regular_pyramids? #51

Closed loongmxbt closed 1 year ago

loongmxbt commented 1 year ago

In documentation and example, I noticed the default size parameter is set to 1

rayflare.textures.standard_rt_textures.regular_pyramids(elevation_angle=55, upright=True, size=1)

size – size of the pyramids; the units are arbitrary, but should be kept consistent across different interfaces if you are not randomizing the ray positions.

If I want to model a pyramid with width 4um like the figure below, how to set the "size" parameter, is it "4" or Si('4um'). And whether the size is the width or the height of the pyramid?

image

Thanks in advance!

phoebe-p commented 1 year ago

Hi, sorry for my extremely slow reply, I missed the email informing me of this new issue... As the documentation says, the size of the surface textures does not matter unless you have multiple textured surfaces, in which case the units should be kept consistent with each other. The reason it doesn't matter is that for the geometrical optics used in the ray-tracing algorithm, we only care about the orientation of each part of the surface (i.e. the 4 triangles for a pyramid) and their relative size; we can shrink or enlarge the whole structure but it will not change the result of the ray-tracing calculation since only refraction is taken into account, and we will not see wave optical effects related to the size of the features. So the width does not really have a unit, and just refers to the size the unit cell will have in the code (so it is the width rather than the height, you can change the height by changing the elevation angle).

loongmxbt commented 1 year ago

@phoebe-p Thanks for your answer! Solves my question.