pyoptics.fdtd.geometry

Shapes that make up a structure.

Every shape has a method contains(x[, y]) that takes broadcastable coordinate arrays and returns a boolean array. Shapes are combined with a medium in a Simulation’s structure list, where later entries are drawn on top of earlier ones. Shapes can be added (union) and subtracted (difference): Circle((0, 0), 2) - Circle((0, 0), 1.5) is a ring.

Classes

Annulus

Ring between two radii (2D), e.g. a ring resonator.

Circle

Disc (2D), the cross section of a cylinder along z.

Difference

Points inside a but not inside b.

Everywhere

The whole domain.

Polygon

Simple polygon (2D, convex or concave) given by its vertices.

Rect

Axis-parallel rectangle (2D) given by its centre and size.

Shape

Base class: a region of space, defined by contains().

Slab

Layer lo <= coordinate < hi along an axis (0: x, 1: y), unbounded in the other directions.

Union

Points inside any of the shapes.

class pyoptics.fdtd.geometry.Shape[source]

Bases: object

Base class: a region of space, defined by contains().

class pyoptics.fdtd.geometry.Union(*shapes)[source]

Bases: Shape

Points inside any of the shapes.

class pyoptics.fdtd.geometry.Difference(a, b)[source]

Bases: Shape

Points inside a but not inside b.

class pyoptics.fdtd.geometry.Everywhere[source]

Bases: Shape

The whole domain.

class pyoptics.fdtd.geometry.Slab(lo, hi, axis=0)[source]

Bases: Shape

Layer lo <= coordinate < hi along an axis (0: x, 1: y), unbounded in the other directions. Works in 1D and 2D.

class pyoptics.fdtd.geometry.Rect(center, size)[source]

Bases: Shape

Axis-parallel rectangle (2D) given by its centre and size.

class pyoptics.fdtd.geometry.Circle(center, radius)[source]

Bases: Shape

Disc (2D), the cross section of a cylinder along z.

class pyoptics.fdtd.geometry.Annulus(center, r_inner, r_outer)[source]

Bases: Shape

Ring between two radii (2D), e.g. a ring resonator.

class pyoptics.fdtd.geometry.Polygon(vertices)[source]

Bases: Shape

Simple polygon (2D, convex or concave) given by its vertices.