homogenize_numpy

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

Dehomogenizes points or vectors.

Parameters:
dataarray_like[[float, float, float] | compas.geometry.Point] | array_like[[float, float, float] | compas.geometry.Vector]

The input data.

wfloat, 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