grid_ceil

photonforge.grid_ceil(value, grid=None, multiple=1)

Snap the value to the current grid rounding towards \(+\infty\).

Parameters:
  • value (float | Sequence[float] | Sequence[Sequence[float]]) – Value or sequence of values to snap.

  • grid (float | None) – Grid dimension. If None, use current grid.

  • multiple (int) – Snap to multiples of the grid. For example, set to 2 to snap the value to multiples of 10 nm on a 5 nm grid.

Returns:

Value snapped to the grid.

Return type:

float | ndarray

See also

config.grid