{
  "title": "GeometryArray",
  "public_path": "flex_rf.tidy3d.GeometryArray",
  "lookup_path": "tidy3d.GeometryArray",
  "slug": "flex_rf/tidy3d/GeometryArray",
  "public_url": "/rf/latest/autogenerated/flex_rf/tidy3d/geometryarray/",
  "object_kind": "class",
  "introduction": "A geometry representing an array of copies of a base geometry, with optional offsets\nand/or linear transformations applied to each copy.",
  "notes": "This class provides an efficient way to represent arrays of repeated geometries,\navoiding the need to create many individual geometry objects.\n\nThe instance pose for each copy is defined as: `T(offsets[i]) @ L(transforms[i])`,\nwhere `T` is a translation matrix and `L` is the linear transform. In other words,\nthe transform is applied first, then the translation.\n\n- `offsets` represent all per-instance translation.\n- `transforms` represent linear transforms only (rotation/reflection/scale/shear)\n  and must not contain translation. Use `offsets` for translations.\n- If both `offsets` and `transforms` are `None`, the array contains a single\n  instance of the base geometry at the origin.\n- If both are provided, they must have the same length.\n- Adjoint/autodiff is not currently supported for `GeometryArray`.",
  "examples": "```python\nimport tidy3d as td\nimport numpy as np\nbox = td.Box(size=(1, 1, 1))\n# Using offsets only:\noffsets = [[0, 0, 0], [2, 0, 0], [0, 2, 0], [2, 2, 0]]\narray = td.GeometryArray(geometry=box, offsets=offsets)\n# Or use the convenience method:\narray = box.array(offsets=offsets)\n# Using linear transforms only (rotation around z-axis):\nrot_0 = td.Transformed.rotation(0, 2)  # no rotation\nrot_90 = td.Transformed.rotation(np.pi/2, 2)  # 90 degree rotation\narray = td.GeometryArray(geometry=box, transforms=[rot_0, rot_90])\n# Both None gives single instance of base geometry:\narray = td.GeometryArray(geometry=box)\n```",
  "references": "",
  "signature": "class GeometryArray(Geometry)",
  "source": {
    "path": "flex/public/tidy3d/tidy3d/components/geometry/base.py",
    "url": "",
    "lineno": 3858,
    "endlineno": 4229
  },
  "bases": [
    "Geometry"
  ],
  "parameter_rows": [
    {
      "name": "geometry",
      "annotation": "discriminated_union(GeometryType)",
      "default": "...",
      "description": "Base geometry to be repeated in the array.",
      "origin": "declared"
    },
    {
      "name": "offsets",
      "annotation": "tuple[Coordinate, ...] | None",
      "default": "None",
      "description": "A tuple of 3D coordinate offsets. Each offset translates the base geometry (after any transform is applied) to create a copy. If not provided, no additional translation is applied beyond any transforms.",
      "origin": "declared"
    },
    {
      "name": "transforms",
      "annotation": "tuple[MatrixReal4x4, ...] | None",
      "default": "None",
      "description": "A tuple of 4x4 linear-only transformation matrices (rotation/reflection/scale/shear, no translation). Typical transforms can be created using `Transformed.rotation`, `Transformed.reflection`, or `Transformed.scaling`. Each transform is applied to the base geometry before the corresponding offset translation. If not provided, only translations from offsets are applied.",
      "origin": "declared"
    },
    {
      "name": "attrs",
      "annotation": "dict",
      "default": "factory: dict",
      "description": "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.model_dump_json()`.",
      "origin": "inherited"
    }
  ],
  "members": [
    {
      "name": "bounds",
      "kind": "function",
      "signature": "bounds()",
      "description": "Returns bounding box min and max coordinates."
    },
    {
      "name": "inside",
      "kind": "function",
      "signature": "inside(x: NDArray[float], y: NDArray[float], z: NDArray[float])",
      "description": "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."
    },
    {
      "name": "intersections_plane",
      "kind": "function",
      "signature": "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)",
      "description": "Returns list of shapely geometries at plane specified by one non-None value of x,y,z."
    },
    {
      "name": "intersections_tilted_plane",
      "kind": "function",
      "signature": "intersections_tilted_plane(normal: Coordinate, origin: Coordinate, to_2D: MatrixReal4x4, cleanup: bool = True, quad_segs: int | None = None, section_tolerance_2d: bool = False)",
      "description": "Return a list of shapely geometries at the plane specified by normal and origin."
    },
    {
      "name": "intersects_axis_position",
      "kind": "function",
      "signature": "intersects_axis_position(axis: int, position: float, section_tolerance_2d: bool = False)",
      "description": "Whether self intersects plane specified by a given position along a normal axis."
    },
    {
      "name": "num_geometries",
      "kind": "function",
      "signature": "num_geometries()",
      "description": "Number of geometries in the array."
    }
  ],
  "group": "flex_rf.tidy3d"
}
