tidy3d.Sphere#

class tidy3d.Sphere#

Spherical geometry.

Parameters
  • radius (NonNegativeFloat) – [units = um]. Radius of geometry.

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

Example

>>> b = Sphere(center=(1,2,3), radius=2)

Show JSON schema
{
   "title": "Sphere",
   "description": "Spherical geometry.\n\nParameters\n----------\nradius : NonNegativeFloat\n    [units = um].  Radius of geometry.\ncenter : Tuple[float, float, float] = (0.0, 0.0, 0.0)\n    [units = um].  Center of object in x, y, and z.\n\nExample\n-------\n>>> b = Sphere(center=(1,2,3), radius=2)",
   "type": "object",
   "properties": {
      "type": {
         "title": "Type",
         "default": "Sphere",
         "enum": [
            "Sphere"
         ],
         "type": "string"
      },
      "radius": {
         "title": "Radius",
         "description": "Radius of geometry.",
         "units": "um",
         "minimum": 0,
         "type": "number"
      },
      "center": {
         "title": "Center",
         "description": "Center of object in x, y, and z.",
         "default": [
            0.0,
            0.0,
            0.0
         ],
         "units": "um",
         "type": "array",
         "minItems": 3,
         "maxItems": 3,
         "items": [
            {
               "type": "number"
            },
            {
               "type": "number"
            },
            {
               "type": "number"
            }
         ]
      }
   },
   "required": [
      "radius"
   ],
   "additionalProperties": false
}

attribute center: Tuple[float, float, float] = (0.0, 0.0, 0.0)#

Center of object in x, y, and z.

Validated by
  • _center_not_inf

inside(x, y, z) bool#

Returns True if point (x,y,z) inside volume of geometry.

Parameters
  • x (float) – Position of point in x direction.

  • y (float) – Position of point in y direction.

  • z (float) – Position of point in z direction.

Returns

Whether point (x,y,z) is inside geometry.

Return type

bool

intersections(x: Optional[float] = None, y: Optional[float] = None, z: Optional[float] = None)#

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.

Returns

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

Return type

List[shapely.geometry.base.BaseGeometry]

property bounds: Tuple[Tuple[float, float, float], Tuple[float, float, float]]#

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]