tidy3d.Sphere#
- class Sphere[source]#
-
Spherical geometry.
- Parameters:
Example
>>> b = Sphere(center=(1,2,3), radius=2)
Attributes
Methods
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_plane([x, y, z, cleanup, ...])Returns shapely geometry at plane specified by one non None value of x,y,z.
intersections_tilted_plane(normal, origin, to_2D)Return a list of shapely geometries at the plane specified by normal and origin.
to_triangle_mesh(*[, max_edge_length, ...])Approximate the sphere surface with a
TriangleMesh.unit_sphere_triangles(*[, ...])Return unit sphere triangles discretized via an icosphere.
- radius#
- to_triangle_mesh(*, max_edge_length=None, subdivisions=None)[source]#
Approximate the sphere surface with a
TriangleMesh.- Parameters:
max_edge_length (float = None) – Maximum edge length for triangulation in micrometers.
subdivisions (int = None) – Number of subdivisions for icosphere generation.
- Returns:
Triangle mesh approximation of the sphere surface.
- Return type:
- 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.
- 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_N_SHAPELY_QUAD_SEGS_VISUALIZATIONfor high-quality visualization.
- Returns:
List of 2D shapes that intersect plane. For more details refer to Shapely’s Documentation.
- Return type:
list[shapely.geometry.base.BaseGeometry]
- intersections_plane(x=None, y=None, z=None, cleanup=True, quad_segs=None)[source]#
Returns shapely geometry at plane specified by one non None value of x,y,z.
- Parameters:
x (float = None) – Position of plane in x direction, only one of x,y,z can be specified to define plane.
y (float = None) – Position of plane in x direction, only one of x,y,z can be specified to define plane.
z (float = None) – Position of plane in x direction, only one of x,y,z can be specified to define plane.
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_N_SHAPELY_QUAD_SEGS_VISUALIZATIONfor high-quality visualization.
- Returns:
List of 2D shapes that intersect plane. For more details refer to Shapely’s Documentation <https://shapely.readthedocs.io/en/stable/project.html>`.
- Return type:
list[shapely.geometry.base.BaseGeometry]
- property bounds#
Returns bounding box min and max coordinates.