tidy3d.components.geometry.polyslab.ComplexPolySlabBase#
- class ComplexPolySlabBase[source]#
Bases:
PolySlabInterface for dividing a complex polyslab where self-intersecting polygon can occur during extrusion. This class should not be used directly. Use instead
plugins.polyslab.ComplexPolySlab.- Parameters:
axis (Literal[0, 1, 2] = 2) – Specifies dimension of the planar axis (0,1,2) -> (x,y,z).
sidewall_angle (Union[float, autograd.tracer.Box] = 0.0) – [units = rad]. Angle of the sidewall.
sidewall_angle=0(default) specifies a vertical wall;0<sidewall_angle<np.pi/2specifies a shrinking cross section along theaxisdirection; and-np.pi/2<sidewall_angle<0specifies an expanding cross section along theaxisdirection.reference_plane (Literal['bottom', 'middle', 'top'] = middle) – The position of the plane where the supplied cross section are defined. The plane is perpendicular to the
axis. The plane is located at thebottom,middle, ortopof the geometry with respect to the axis. E.g. ifaxis=1,bottomrefers to the negative side of the y-axis, andtoprefers to the positive side of the y-axis.slab_bounds (tuple[Union[float, autograd.tracer.Box], Union[float, autograd.tracer.Box]]) – [units = um]. Minimum and maximum positions of the slab along axis dimension.
dilation (float = 0.0) – [units = um]. Dilation of the supplied polygon by shifting each edge along its normal outwards direction by a distance; a negative value corresponds to erosion.
vertices (Union[ArrayLike[dtype=float, ndim=2], autograd.tracer.Box]) – [units = um]. List of (d1, d2) defining the 2 dimensional positions of the polygon face vertices at the
reference_plane. The index of dimension should be in the ascending order: e.g. if the slab normal axis isaxis=y, the coordinate of the vertices will be in (x, z)bulges (Optional[ArrayLike[dtype=float, ndim=1]] = None) – List of values describing the bulge of each edge, following the typical convention:
bulge = tan(θ/4)where θ is the included angle of the arc. Whenbulges=None, all segments are straight lines; otherwise, the number of bulge values must equal the number of vertices.bulges[i]defines the arc on the edge from vertexito vertex(i+1) mod N. Sign convention:bulge=0means straight line;bulge>0bulges outward (for CCW polygons);bulge<0bulges inward. All values must be finite. Canonicalization: bulges are kept synchronized with vertices during internal canonicalization. When winding order is reversed to CCW (i.e., when the input polygon is CW), bulges are permuted to match the reversed edges and their signs are flipped. When duplicate adjacent vertices are removed, the corresponding zero-bulge entry is dropped; a zero-length edge with non-zero bulge raisesSetupError.
Attributes
Divide a complex polyslab into a list of simple polyslabs, which are assembled into a
GeometryGroup.Divide a complex polyslab into a list of simple polyslabs.
slab_boundsdilationverticesbulgesaxissidewall_anglereference_planeMethods
from_gds(gds_cell, axis, slab_bounds, gds_layer)Import
PolySlabfrom agdstk.Cell.intersections_tilted_plane(normal, origin, to_2D)Return a list of shapely geometries at the plane specified by normal and origin.
Turn off the validation for this class.
- classmethod from_gds(gds_cell, axis, slab_bounds, gds_layer, gds_dtype=None, gds_scale=1.0, dilation=0.0, sidewall_angle=0, reference_plane='middle')[source]#
Import
PolySlabfrom agdstk.Cell.- Parameters:
gds_cell (gdstk.Cell) –
gdstk.Cellcontaining 2D geometric data.axis (int) – Integer index into the polygon’s slab axis. (0,1,2) -> (x,y,z).
slab_bounds (tuple[float, float]) – Minimum and maximum positions of the slab along
axis.gds_layer (int) – Layer index in the
gds_cell.gds_dtype (int = None) – Data-type index in the
gds_cell. IfNone, imports all data for this layer into the returned list.gds_scale (float = 1.0) – Length scale used in GDS file in units of MICROMETER. For example, if gds file uses nanometers, set
gds_scale=1e-3. Must be positive.dilation (float = 0.0) – 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.
sidewall_angle (float = 0) – Angle of the sidewall.
sidewall_angle=0(default) specifies vertical wall, while0<sidewall_angle<np.pi/2for the base to be larger than the top.reference_plane (PlanePosition = "middle") – The position of the GDS layer. It can be at the
bottom,middle, ortopof the PolySlab. E.g. ifaxis=1,bottomrefers to the negative side of y-axis, andtoprefers to the positive side of y-axis.
- Returns:
List of
PolySlabobjects sharingaxisand slab bound properties.- Return type:
list[
PolySlab]
- property geometry_group#
Divide a complex polyslab into a list of simple polyslabs, which are assembled into a
GeometryGroup.- Returns:
GeometryGroup for a list of simple polyslabs divided from the complex polyslab.
- Return type:
- property sub_polyslabs#
Divide a complex polyslab into a list of simple polyslabs. Only neighboring vertex-vertex crossing events are treated in this version.
- intersections_tilted_plane(normal, origin, to_2D, cleanup=True, quad_segs=None)[source]#
Return a list of shapely geometries at the plane specified by normal and origin.
- Parameters:
normal (Coordinate) – Vector defining the normal direction to the plane.
origin (Coordinate) – Vector defining the plane origin.
to_2D (MatrixReal4x4) – Transformation matrix to apply to resulting shapes.
cleanup (bool = True) – If True, removes extremely small features from each polygon’s boundary.
quad_segs (Optional[int] = None) – Number of segments used to discretize circular shapes. Not used for PolySlab.
- Returns:
List of 2D shapes that intersect plane. For more details refer to Shapely’s Documentation.
- Return type:
list[shapely.geometry.base.BaseGeometry]