get_bounding_box_point#

k3d.helpers.get_bounding_box_point(position, model_matrix=None)[source]#

Return the boundaries of one or more 3D positions.

Parameters:
  • position (array_like) – One position, n positions, or a time series of either.

  • model_matrix (ndarray, optional) – Matrix of numbers the renderer applies to the position. Must have four columns.

Returns:

Array of numbers [min_x, max_x, min_y, max_y, min_z, max_z], or None for a position that is not three-dimensional (a 2D overlay has no place in the scene’s box).

Return type:

ndarray or None

Examples#

import k3d
import numpy as np

pos = np.array([1, 2, 3])

box_point = k3d.helpers.get_bounding_box_point(pos)

"""
array([1, 1, 2, 2, 3, 3])
"""