homogenize_and_flatten_frames_numpy

compas.geometry.homogenize_and_flatten_frames_numpy(frames)[source]

Homogenize a list of frames and flatten the 3D list into a 2D list using numpy.

The frame consists of a point and 2 orthonormal vectors.

Parameters

frames (list of Frame)

Returns

numpy.ndarray – An array of points and vectors.

Examples

>>> from compas.geometry import Frame
>>> frames = [Frame((1, 1, 1), (0, 1, 0), (1, 0, 0))]
>>> res = homogenize_and_flatten_frames_numpy(frames)
>>> np.allclose(res, [[1.0, 1.0, 1.0, 1.0], [0.0, 1.0, 0.0, 0.0], [1.0, -0.0, 0.0, 0.0]])
True