get_bounding_box_points#

k3d.helpers.get_bounding_box_points(arr, model_matrix)[source]#

Return the minimum and maximum coordinates on x, y, z axes.

Parameters
  • arr (ndarray) – Array of vertices [x, y, z].

  • model_matrix (ndarray) – Matrix of numbers. Must have four columns.

Returns

Array of numbers [min_x, max_x, min_y, max_y, min_z, max_z].

Return type

ndarray

Examples#

import k3d
import numpy as np

arr = np.array([[-47,   0,  34],
                [-34,  11,  30],
                [ 13,  49, -48],
                [-48,  30,   8],
                [-10, -40, -12],
                [-27,  40,   4],
                [-40,  18,   3],
                [-28,  43, -43],
                [-35, -12, -21],
                [-10, -18, -40]])

model_matrix = np.identity(4)

box_points = k3d.helpers.get_bounding_box_points(arr, model_matrix)

"""
array([-48.,  13., -40.,  49., -48.,  34.])
"""