tidy3d.Sphere#

class tidy3d.Sphere#

Spherical geometry.

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

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

Example

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

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

Fields
  • radius (pydantic.types.NonNegativeFloat)

attribute radius: pydantic.types.NonNegativeFloat [Required]#

Radius of geometry.

Constraints
  • minimum = 0

Validated by
  • _radius_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#

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]