resqpy.olio.triangulation.reorient

resqpy.olio.triangulation.reorient(points, rough=True, max_dip=None, use_linalg=False)[source]

Returns a reoriented copy of a set of points, such that z axis is approximate normal to average plane of points.

Parameters:
  • points (numpy float array of shape (..., 3)) – the points to be reoriented

  • rough (bool, default True) – if True, the resulting orientation will be within around 10 degrees of the optimum; if False, that reduces to around 2.5 degrees of the optimum; iugnored if use_linalg is True

  • max_dip (float, optional) – if present, the reorientation of perspective off vertical is limited to this angle in degrees

  • use_linalg (bool, default False) – if True, the numpy linear algebra svd function is used and rough is ignored

Returns:

numpy float array of the same shape as points, numpy xyz vector, numpy 3x3 matrix; the array being a copy of points rotated in 3D space to minimise the z range; the vector is a normal vector to the original points; the matrix is rotation matrix used to transform the original points to the reoriented points

Notes

the original points array is not modified by this function; implicit xy & z units for points are assumed to be the same; the function may typically be called prior to the Delauney triangulation, which uses an xy projection to determine the triangulation; the numpy linear algebra option seems to be memory intensive