mrdja.drawing.draw_cube

mrdja.drawing.draw_cube(cube_min: ndarray, cube_max: ndarray, color: str = 'red', alpha: float = 0.5, ax=None)[source]

Draws a cube in 3D space using matplotlib.

Parameters:
  • cube_min (numpy.ndarray) – A 3x1 numpy array containing the minimum x, y, and z values of the cube.

  • cube_max (numpy.ndarray) – A 3x1 numpy array containing the maximum x, y, and z values of the cube.

  • color (str) – The color of the cube.

  • alpha (float) – The transparency of the cube.

Returns:

None

Return type:

None

Example:

>>> import mrdja.drawing as drawing
>>> import numpy as np
>>> cube_min = np.array([-2, -2, -1])
>>> cube_max = np.array([1, 2, 2])
>>> drawing.draw_cube(cube_min, cube_max, color="red", alpha=0.5)

drawing_draw_cube_example