From 091907b1dfbad53cce6e6f5b9313445004596833 Mon Sep 17 00:00:00 2001 From: Miles Date: Wed, 24 Jan 2024 11:32:24 -0500 Subject: [PATCH 1/2] Update component.py added ability to user edit "reference_plane" for Tidy3DComponent --- gplugins/tidy3d/component.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gplugins/tidy3d/component.py b/gplugins/tidy3d/component.py index 8eda85ed..d933223d 100644 --- a/gplugins/tidy3d/component.py +++ b/gplugins/tidy3d/component.py @@ -18,7 +18,7 @@ import time from collections.abc import Awaitable from functools import cached_property -from typing import Any +from typing import Any, Literal import matplotlib.pyplot as plt import numpy as np @@ -66,6 +66,8 @@ class Tidy3DComponent(LayeredComponentBase): dilation (float): Dilation of the polygon in the base by shifting each edge along its normal outwards direction by a distance; a negative value corresponds to erosion. Defaults to zero. + reference_plane (Literal["bottom", "middle", "top"]): the reference plane + used by tidy3d's PolySlab when applying sidewall_angle to a layer """ material_mapping: dict[str, Tidy3DMedium] = material_name_to_medium @@ -76,6 +78,7 @@ class Tidy3DComponent(LayeredComponentBase): pad_z_inner: float = 0.0 pad_z_outer: NonNegativeFloat = 0.0 dilation: float = 0.0 + reference_plane: Literal["bottom", "middle", "top"] = "middle" @cached_property def polyslabs(self) -> dict[str, tuple[td.PolySlab, ...]]: @@ -96,7 +99,7 @@ def polyslabs(self) -> dict[str, tuple[td.PolySlab, ...]]: axis=2, slab_bounds=(bbox[0][2], bbox[1][2]), sidewall_angle=np.deg2rad(layer.sidewall_angle), - reference_plane="middle", + reference_plane=self.reference_plane, dilation=self.dilation, ) for v in self.get_vertices(name) From 26d2b7bf6cd27fa5293ce7fa2f04bb39a1a873fe Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 24 Jan 2024 16:37:32 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- gplugins/tidy3d/component.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gplugins/tidy3d/component.py b/gplugins/tidy3d/component.py index d933223d..cfa575bb 100644 --- a/gplugins/tidy3d/component.py +++ b/gplugins/tidy3d/component.py @@ -66,7 +66,7 @@ class Tidy3DComponent(LayeredComponentBase): dilation (float): Dilation of the polygon in the base by shifting each edge along its normal outwards direction by a distance; a negative value corresponds to erosion. Defaults to zero. - reference_plane (Literal["bottom", "middle", "top"]): the reference plane + reference_plane (Literal["bottom", "middle", "top"]): the reference plane used by tidy3d's PolySlab when applying sidewall_angle to a layer """