Skip to content

flex_rf.tidy3d.Box

Type: class Base(s): SimplePlaneIntersection, Centered

Rectangular prism. Also base class for Simulation, Monitor, and Source.

b = Box(center=(1,2,3), size=(2,2,2))
size [TracedSize]

Size in x, y, and z directions.

center [TracedCoordinate] = (0.0, 0.0, 0.0)

Center of object in x, y, and z.

bounds()

Returns bounding box min and max coordinates.

from_bounds(rmin: Coordinate, rmax: Coordinate, **kwargs: Any)

Constructs a Box from minimum and maximum coordinate bounds

geometry()

Box representation of self (used for subclasses of Box).

inside(x: NDArray[float], y: NDArray[float], z: NDArray[float])

For input arrays x, y, z of arbitrary but identical shape, return an array with the same shape which is True for every point in zip(x, y, z) that is inside the volume of the Geometry, and False otherwise.

intersections_plane(x: float | None = None, y: float | None = None, z: float | None = None, cleanup: bool = True, quad_segs: int | None = None, section_tolerance_2d: bool = False)

Returns shapely geometry at plane specified by one non None value of x,y,z.

intersections_with(other: Geometry, cleanup: bool = True, quad_segs: int | None = None, section_tolerance_2d: bool = False)

Returns list of shapely geometries representing the intersections of the geometry with this 2D box.

padded_copy(x: tuple[pydantic.NonNegativeFloat, pydantic.NonNegativeFloat] | None = None, y: tuple[pydantic.NonNegativeFloat, pydantic.NonNegativeFloat] | None = None, z: tuple[pydantic.NonNegativeFloat, pydantic.NonNegativeFloat] | None = None)

Created a padded copy of a Box instance.

slightly_enlarged_copy()

Box size slightly enlarged around machine precision.

surfaces(size: Size, center: Coordinate, **kwargs: Any)

Returns a list of 6 Box instances corresponding to each surface of a 3D volume. The output surfaces are stored in the order [x-, x+, y-, y+, z-, z+], where x, y, and z denote which axis is perpendicular to that surface, while ”-” and ”+” denote the direction of the normal vector of that surface. If a name is provided, each output surface’s name will be that of the provided name appended with the above symbols. E.g., if the provided name is “box”, the x+ surfaces’s name will be “box_x+”.

surfaces_with_exclusion(size: Size, center: Coordinate, **kwargs: Any)

Returns a list of 6 Box instances corresponding to each surface of a 3D volume. The output surfaces are stored in the order [x-, x+, y-, y+, z-, z+], where x, y, and z denote which axis is perpendicular to that surface, while ”-” and ”+” denote the direction of the normal vector of that surface. If a name is provided, each output surface’s name will be that of the provided name appended with the above symbols. E.g., if the provided name is “box”, the x+ surfaces’s name will be “box_x+”. If kwargs contains an exclude_surfaces parameter, the returned list of surfaces will not include the excluded surfaces. Otherwise, the behavior is identical to that of surfaces().

zero_dims()

A list of axes along which the Box is zero-sized.