Skip to content

geometry

Geometry wrapper for gdsfactory components.

This module provides a Geometry class that wraps gdsfactory Components with computed properties useful for simulation setup.

Classes:

  • Geometry –

    Shared geometry wrapper for gdsfactory Component.

Geometry

Bases: BaseModel

Shared geometry wrapper for gdsfactory Component.

This class wraps a gdsfactory Component and provides computed properties that are useful for simulation setup (bounds, ports, etc.).

Attributes:

  • component (Any) –

    The wrapped gdsfactory Component

Example

from gdsfactory.components import straight c = straight(length=100) geom = Geometry(component=c) print(geom.bounds) (0.0, -0.25, 100.0, 0.25)

Methods:

bounds cached property

bounds: tuple[float, float, float, float]

Get bounding box (xmin, ymin, xmax, ymax) in um.

height property

height: float

Get height (y-extent) of geometry in um.

port_names cached property

port_names: list[str]

Get list of port names.

ports cached property

ports: list

Get list of ports on the component.

width property

width: float

Get width (x-extent) of geometry in um.

get_port

get_port(name: str) -> Any

Get a port by name.

Parameters:

  • name (str) –

    Port name to find

Returns:

  • Any –

    Port object if found, None otherwise