flex_rf.tidy3d.PolySlab
Type: class │ Base(s): Planar
Description
Section titled “Description”Polygon extruded with optional sidewall angle along axis direction.
Polygon edges may optionally be circular arcs via the bulges parameter, which
follows the convention: bulge = tan(θ/4) where θ is the
included angle of the arc. For CCW polygon, a positive bulge produces an arc that bulges outward
; a negative bulge bulges inward; and zero means a straight edge.
Example(s)
Section titled “Example(s)”vertices = np.array([(0,0), (1,0), (1,1)])p = PolySlab(vertices=vertices, axis=2, slab_bounds=(-1, 1))# With arc segments (a rounded edge from vertex 1 to vertex 2):p_arc = PolySlab( vertices=vertices, axis=2, slab_bounds=(-1, 1), bulges=[0, 0.5, 0])Parameters
Section titled “Parameters”slab_bounds [tuple[TracedFloat, TracedFloat]] |
|
Minimum and maximum positions of the slab along axis dimension. |
vertices [TracedArrayFloat2D] |
|
List of (d1, d2) defining the 2 dimensional positions of the polygon face vertices at the |
axis [Axis] = 2 |
|
Specifies dimension of the planar axis (0,1,2) -> (x,y,z). |
sidewall_angle [TracedFloat] = 0.0 |
|
Angle of the sidewall. |
reference_plane [PlanePosition] = 'middle' |
|
The position of the plane where the supplied cross section are defined. The plane is perpendicular to the |
dilation [float] = 0.0 |
|
Dilation of the supplied polygon by shifting each edge along its normal outwards direction by a distance; a negative value corresponds to erosion. |
bulges [ArrayFloat1D | None] = None |
|
List of values describing the bulge of each edge, following the typical convention: |
Attributes
Section titled “Attributes”center_axis [float] |
|
Gets the position of the center of the geometry in the out of plane dimension. |
finite_length_axis [float] |
|
Gets the length of the PolySlab along the out of plane dimension. First clips the slab bounds to LARGE_NUMBER and then returns difference. |
length_axis [float] |
|
Gets the length of the geometry along the out of plane dimension. |
Methods
Section titled “Methods”array_to_vertices(arr_vertices: NDArray) |
|
Converts a numpy array of vertices to a list of tuples. |
base_polygon() |
|
The polygon at the base, derived from the |
bounds() |
|
Returns bounding box min and max coordinates. The dilation and slant angle are not taken into account exactly for speed. Instead, the polygon may be slightly smaller than the returned bounds, but it should always be fully contained. |
compute_derivative_slab_bounds_line(derivative_info: DerivativeInfo, extents: NDArray, r1_min: float, r1_max: float, r2_min: float, r2_max: float, ax_val: float, face_poly: shapely.Polygon, min_max_index: int, interpolators: dict) |
|
Handle degenerate line cross-section case |
compute_derivative_slab_bounds_surface(derivative_info: DerivativeInfo, extents: NDArray, r1_min: float, r1_max: float, r2_min: float, r2_max: float, ax_val: float, face_poly: shapely.Polygon, min_max_index: int, interpolators: dict) |
|
2d surface integral on a Gauss quadrature grid |
correct_shape(val: ArrayFloat2D) |
|
Makes sure vertices size is correct. Make sure no intersecting edges. |
edge_basis_vectors(edges: NDArray) |
|
Normalized basis vectors for |
from_gds(gds_cell: Cell, axis: Axis, slab_bounds: tuple[float, float], gds_layer: int, gds_dtype: int | None = None, gds_scale: PositiveFloat = 1.0, dilation: float = 0.0, sidewall_angle: float = 0, reference_plane: PlanePosition = 'middle') |
|
Import |
inside(x: NDArray[float], y: NDArray[float], z: NDArray[float]) |
|
For input arrays |
interior_angle() |
|
Angle formed inside polygon by two adjacent edges. |
is_ccw() |
|
Is this |
make_shapely_polygon(vertices: ArrayLike) |
|
Make a shapely polygon from some vertices, first ensures they are untraced. |
middle_polygon() |
|
The polygon at the middle. |
no_complex_self_intersecting_polygon_at_reference_plane() |
|
At the reference plane, check if the polygon is self-intersecting. |
no_self_intersecting_polygon_during_extrusion() |
|
In this simple polyslab, we don’t support self-intersecting polygons yet, meaning that any normal cross section of the PolySlab cannot be self-intersecting. This part checks if any self-interction will occur during extrusion with non-zero sidewall angle. |
normalize_vect(arr: NDArray) |
|
normalize an array shaped (N, d) along the |
pop_axis_vect(coord: NDArray) |
|
Combine coordinate along axis with coordinates on the plane tangent to the axis. |
reference_polygon() |
|
The polygon at the reference plane. |
reflected(normal: Coordinate) |
|
Return a reflected copy of this geometry. |
rotated(angle: float, axis: Axis | Coordinate) |
|
Return a rotated copy of this geometry. |
scaled(x: float = 1.0, y: float = 1.0, z: float = 1.0) |
|
Return a scaled copy of this geometry. |
slab_bounds_order(val: tuple[float, float]) |
|
Maximum position of the slab should be no smaller than its minimal position. |
top_polygon() |
|
The polygon at the top, derived from the |
translated(x: float, y: float, z: float) |
|
Return a translated copy of this geometry. |
unpop_axis_vect(ax_coords: NDArray, plane_coords: NDArray) |
|
Combine coordinate along axis with coordinates on the plane tangent to the axis. |
vertices_to_array(vertices_tuple: ArrayFloat2D) |
|
Converts a list of tuples (vertices) to a numpy array. |