Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A problem of "SetLayerPatternPolygon" #109

Open
fr0ger opened this issue Oct 28, 2023 · 1 comment
Open

A problem of "SetLayerPatternPolygon" #109

fr0ger opened this issue Oct 28, 2023 · 1 comment

Comments

@fr0ger
Copy link

fr0ger commented Oct 28, 2023

Hi. I want to set a slab which is made of a unit cell like this:
屏幕截图 2023-10-28 112557

The part framed by the red line is the cell I constructed. Inside this, I expect all the triangles are air(epsilon=1), and the rest to be a uniform medium(epsilon=2.02^2).

The problem is when I set these triangles with S:SetLayerPatternPolygon, even though I have set them to epsilon=1, I always end up with an error when I use S:GetEpsilon to check the dielectric constant distribution, as shown in the image above (yellow means high permittivity refer to color bar).

I think this problem is universal. Because no matter how I switch my SetLayerPatternPolygons, those triangles with abnormal permittivity will always be the second-to-last and third-to-last.

I wonder if there is a solution or a way around it. Many thanks!
image

@fr0ger
Copy link
Author

fr0ger commented Oct 28, 2023

Thank God it didn't take me long to solve the problem.

The reason is I defined the center of the right triangle at the right-edge side, so the program can't tell what's inside or outside the boundary.

But also defining the center of a right triangle inside the triangle means you need to set one more parameter and consider more complex geometric relationships. So I don't recommend adding this parameter unless you have to.

My ultimate goal is to set up six equilateral triangles. So my solution is to define the equilateral triangle directly, even though it crosses the unit cell boundary you defined. Rest assured that this will not cause any errors. Hopefully this will be helpful for people who need to define complex graphics.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant