#!/usr/bin/env python3
# voxel

import matplotlib.pyplot as plt
import numpy as np

plt.style.use('_mpl-gallery')

# Prepare some coordinates
x, y, z = np.indices((8, 8, 8))

# Draw cuboids in the top left and bottom right corners
cube1 = (x < 3) & (y < 3) & (z < 3)
cube2 = (x >= 5) & (y >= 5) & (z >= 5)

# Combine the objects into a single boolean array
voxelarray = cube1 | cube2

# Plot
fig, ax = plt.subplots(subplot_kw={"projection": "3d"})
ax.voxels(voxelarray, edgecolor='k')

ax.set(xticklabels=[],
       yticklabels=[],
       zticklabels=[])

from os import environ
VERHOME = environ ['VERHOME']                  # VERHOME: vereda home | set by /foo/ver/lib/setup

from zorro import mkdir
DOT =  VERHOME + '/output'                     # DOT: Directory OutpuT
mkdir ( DOT )                                  # create directory if it does not exist
plt.savefig ( DOT + '/voxel.png' )

#------------------------------------------------#-------------------------------------------#
'''
Notices and documentation

title:voxel
description:vereda information
creator:see rights|minor modifications by M.T. Carrasco Benitez
source:https://matplotlib.org/stable/plot_types/3D/voxels_simple.html#sphx-glr-plot-types-3d-voxels-simple-py
rights:Copyright 2002–2012 John Hunter, Darren Dale, Eric Firing, Michael Droettboom and the Matplotlib development team; 2012–2023 The Matplotlib development team. 
'''
##
