tidy3d.Transformed#
- class Transformed[source]#
Bases:
GeometryClass representing a transformed geometry.
- Parameters:
geometry (Union[
Box,Transformed,ClipOperation,GeometryGroup,GeometryArray,Sphere,Cylinder,PolySlab,ComplexPolySlabBase,TriangleMesh]) – Base geometry to be transformed.transform (ArrayLike[dtype=float, ndim=2, shape=(4, 4)] = [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]]) – Transform matrix applied to the base geometry.
Attributes
Returns bounding box min and max coordinates.
Inverse of this transform.
Methods
identity()Return an identity matrix where no transform is applied.
inside(x, y, z)For input arrays
x,y,zof arbitrary but identical shape, return an array with the same shape which isTruefor every point in zip(x, y, z) that is inside the volume of theGeometry, andFalseotherwise.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.
- geometry#
- transform#
- property inverse#
Inverse of this transform.
- property bounds#
Returns bounding box min and max coordinates.
- 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,zof arbitrary but identical shape, return an array with the same shape which isTruefor every point in zip(x, y, z) that is inside the volume of theGeometry, andFalseotherwise.
- 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 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 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:
Trueif the transformation preserves the axis orientation,Falseotherwise.- Return type: