homogenize_numpy

compas.geometry.homogenize_numpy(data, w=1.0)[source]

Dehomogenizes points or vectors.

Parameters
  • data (array_like[[float, float, float] | Point] | array_like[[float, float, float] | Vector]) – The input data.

  • w (float, optional) – The homogenization factor. Use 1.0 for points, and 0.0 for vectors.

Returns

(N, 4) ndarray

Examples

>>> points = [[1, 1, 1], [0, 1, 0], [1, 0, 0]]
>>> res = homogenize_numpy(points, w=1.0)
>>> np.allclose(res, [[1.0, 1.0, 1.0, 1.0], [0.0, 1.0, 0.0, 1.0], [1.0, -0.0, 0.0, 1.0]])
True