upxo.geoEntities.geoOps3D module

Generic 3D geometry helpers.

upxo.geoEntities.geoOps3D.local_global_offset(bounds, gid)[source]

Return z-y-x offset from bounds for a one-based grain ID.

Parameters:
  • bounds (dict) – Bounds dictionary containing 'zmins', 'ymins', and 'xmins' arrays indexed by zero-based grain position.

  • gid (int) – One-based grain identifier.

Returns:

Offset ordered as [zmin, ymin, xmin].

Return type:

numpy.ndarray, shape (3,)

upxo.geoEntities.geoOps3D.offset_local_to_global(local_coord, offset)[source]

Apply a z-y-x local-to-global coordinate offset.

Parameters:
  • local_coord (array-like, shape (..., 3)) – Local 3D coordinate or coordinate array.

  • offset (array-like, shape (3,)) – Offset ordered consistently with local_coord.

Returns:

Global coordinate array produced by adding offset.

Return type:

numpy.ndarray