tidy3d.Transformed#

class Transformed[source]#

Bases: Geometry

Class representing a transformed geometry.

Parameters:

Attributes

bounds

Returns bounding box min and max coordinates.

inverse

Inverse of this transform.

geometry

transform

Methods

identity()

Return an identity matrix where no transform is applied.

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.

intersections_tilted_plane(normal, origin, to_2D)

Return a list of shapely geometries at the plane specified by normal and origin.

preserves_axis(transform, axis)

Indicate if the transform preserves the orientation of a given axis.

reflection(normal)

Return a reflection matrix.

rotation(angle, axis)

Return a rotation matrix.

scaling([x, y, z])

Return a scaling matrix.

translation(x, y, z)

Return a translation matrix.

Inherited Common Usage

geometry#
transform#
property inverse#

Inverse of this transform.

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]

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. If None, uses high-quality visualization settings.

Returns:

List of 2D shapes that intersect plane. For more details refer to Shapely’s Documentation.

Return type:

list[shapely.geometry.base.BaseGeometry]

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]

static identity()[source]#

Return an identity matrix where no transform is applied.

Returns:

Identity transform matrix with shape (4, 4).

Return type:

numpy.ndarray

static translation(x, y, z)[source]#

Return a translation matrix.

Parameters:
  • x (float) – Translation along x.

  • y (float) – Translation along y.

  • z (float) – Translation along z.

Returns:

Transform matrix with shape (4, 4).

Return type:

numpy.ndarray

static scaling(x=1.0, y=1.0, z=1.0)[source]#

Return a scaling matrix.

Parameters:
  • x (float = 1.0) – Scaling factor along x.

  • y (float = 1.0) – Scaling factor along y.

  • z (float = 1.0) – Scaling factor along z.

Returns:

Transform matrix with shape (4, 4).

Return type:

numpy.ndarray

static rotation(angle, axis)[source]#

Return a rotation matrix.

Parameters:
  • angle (float) – Rotation angle (in radians).

  • axis (Union[int, tuple[float, float, float]]) – Axis of rotation: 0, 1, or 2 for x, y, and z, respectively, or a 3D vector.

Returns:

Transform matrix with shape (4, 4).

Return type:

numpy.ndarray

static reflection(normal)[source]#

Return a reflection matrix.

Parameters:

normal (tuple[float, float, float]) – Normal of the plane of reflection.

Returns:

Transform matrix with shape (4, 4).

Return type:

numpy.ndarray

static preserves_axis(transform, axis)[source]#

Indicate if the transform preserves the orientation of a given axis.

Parameters: transform: MatrixReal4x4

Transform matrix to check.

axisint

Axis to check. Values 0, 1, or 2, to check x, y, or z, respectively.

Returns:

True if the transformation preserves the axis orientation, False otherwise.

Return type:

bool