tidy3d.Cylinder#

class Cylinder[source]#

Bases: Centered, Circular, Planar

Cylindrical geometry with optional sidewall angle along axis direction. When sidewall_angle is nonzero, the shape is a conical frustum or a cone.

Parameters:
  • attrs (dict = {}) – Dictionary storing arbitrary metadata for a Tidy3D object. This dictionary can be freely used by the user for storing data without affecting the operation of Tidy3D as it is not used internally. Note that, unlike regular Tidy3D fields, attrs are mutable. For example, the following is allowed for setting an attr obj.attrs['foo'] = bar. Also note that Tidy3D` will raise a TypeError if attrs contain objects that can not be serialized. One can check if attrs are serializable by calling obj.json().

  • axis (Literal[0, 1, 2] = 2) – Specifies dimension of the planar axis (0,1,2) -> (x,y,z).

  • sidewall_angle (ConstrainedFloatValue = 0.0) – [units = rad]. Angle of the sidewall. sidewall_angle=0 (default) specifies a vertical wall; 0<sidewall_angle<np.pi/2 specifies a shrinking cross section along the axis direction; and -np.pi/2<sidewall_angle<0 specifies an expanding cross section along the axis direction.

  • 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 the bottom, middle, or top of the geometry with respect to the axis. E.g. if axis=1, bottom refers to the negative side of the y-axis, and top refers to the positive side of the y-axis.

  • radius (NonNegativeFloat) – [units = um]. Radius of geometry at the reference_plane.

  • center (Tuple[float, float, float] = (0.0, 0.0, 0.0)) – [units = um]. Center of object in x, y, and z.

  • length (NonNegativeFloat) – [units = um]. Defines thickness of cylinder along axis dimension.

Example

>>> c = Cylinder(center=(1,2,3), radius=2, length=5, axis=2)

Attributes

bounds

Returns bounding box min and max coordinates.

center_axis

Gets the position of the center of the geometry in the out of plane dimension.

length_axis

Gets the length of the geometry along the out of plane dimension.

radius_bottom

radius of bottom

radius_max

max(radius of top, radius of bottom)

radius_min

min(radius of top, radius of bottom).

radius_top

radius of bottom

attrs

Methods

inside(x,Β y,Β z)

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.

Inherited Common Usage

radius#
length#
property center_axis#

Gets the position of the center of the geometry in the out of plane dimension.

property length_axis#

Gets the length of the geometry along the out of plane dimension.

inside(x, y, z)[source]#

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.

Parameters:
  • x (np.ndarray[float]) – Array of point positions in x direction.

  • y (np.ndarray[float]) – Array of point positions in y direction.

  • z (np.ndarray[float]) – Array of point positions in z direction.

Returns:

True for every point that is inside the geometry.

Return type:

np.ndarray[bool]

property bounds#

Returns bounding box min and max coordinates.

Returns:

Min and max bounds packaged as (minx, miny, minz), (maxx, maxy, maxz).

Return type:

Tuple[float, float, float], Tuple[float, float, float]

property radius_bottom#

radius of bottom

property radius_top#

radius of bottom

property radius_max#

max(radius of top, radius of bottom)

property radius_min#

min(radius of top, radius of bottom). It can be negative for a large sidewall angle.

__hash__()#

Hash method.