route_length

photonforge.route_length(component, layer=None, port_spec=None)[source]

Measure the length of parametric routes.

Internally, this functions adds the path lengths (without offsets) for all paths with distinct endpoints in a specific layer.

Parameters:
  • component (Component) – Component with routes to be measured.

  • layer (Sequence[int] | None) – Layer to be used to search for paths. If None, a best guess based on port_spec will be used.

  • port_spec (PortSpec | None) – Port specification used for the route. If None, the component will be inspected and a best guess used.

Returns:

Total path length.

Return type:

float