# Examples from pyvista.core._structured_data._StructuredDataMixin.offset
# =======================================================================

# Create an `ImageData` and show that the offset is zeros by default.
import pyvista as pv
grid = pv.ImageData(dimensions=(10, 10, 10))
grid.offset

# The offset defines the minimum extent.
grid.extent

# Set the offset to a new value for all axes.
grid.offset = 2
grid.offset

# Show the extent again. Note how all values have increased by the offset value.
grid.extent

# Set the offset for each axis separately and show the extent again.
grid.offset = (-1, -2, -3)
grid.extent

# Set the offset of a `StructuredGrid`. Its points, and therefore its bounds,
# are unchanged.
grid = pv.ImageData(dimensions=(3, 3, 3)).cast_to_structured_grid()
grid.offset = (-1, -2, -3)
grid.extent

grid.bounds

# ----------------------------------------------------------------------
# Generated by sphinx-examples-as-code https://github.com/pyvista/sphinx-examples-as-code
