3D Voxels

Medical Plus Sign Voxels

3D medical plus sign with neon mint green coloring.

Output
Medical Plus Sign Voxels
Python
import matplotlib.pyplot as plt
import numpy as np

n = 15
np.random.seed(42)

# Generate maze-like walls
voxels = np.zeros((n, n, 5), dtype=bool)

# Vertical walls
for i in range(0, n, 3):
    voxels[i, :, :] = True
    
# Horizontal walls with gaps
for j in range(0, n, 3):
    voxels[:, j, :] = True
    # Create gaps
    gap = np.random.randint(0, n)
    voxels[gap:gap+2, j, :] = False

# Colors: gradient from blue #276CF5 to purple #4927F5
x_idx = np.indices((n, n, 5))[0]
colors = np.empty(voxels.shape + (4,), dtype=np.float32)
colors[..., 3] = 0

norm_x = x_idx / (n - 1)
# 276CF5 -> 4927F5
colors[voxels, 0] = 0.15 + 0.14 * norm_x[voxels]  # 27 to 49
colors[voxels, 1] = 0.42 - 0.27 * norm_x[voxels]  # 6C to 27
colors[voxels, 2] = 0.96  # F5 (constant)
colors[voxels, 3] = 0.85

fig = plt.figure(figsize=(10, 8), facecolor='#020B14')
ax = fig.add_subplot(111, projection='3d', facecolor='#020B14')

ax.voxels(voxels, facecolors=colors, edgecolors='#1e293b', linewidth=0.3)

ax.set_xlabel('X', fontsize=11, color='#94a3b8', labelpad=10)
ax.set_ylabel('Y', fontsize=11, color='#94a3b8', labelpad=10)
ax.set_zlabel('Z', fontsize=11, color='#94a3b8', labelpad=10)
ax.set_title('3D Maze Walls', fontsize=14, color='white', fontweight='bold', pad=20)

ax.tick_params(colors='#64748b', labelsize=8)
ax.xaxis.pane.fill = False
ax.yaxis.pane.fill = False
ax.zaxis.pane.fill = False
ax.xaxis.pane.set_edgecolor('#1e293b')
ax.yaxis.pane.set_edgecolor('#1e293b')
ax.zaxis.pane.set_edgecolor('#1e293b')
ax.grid(True, alpha=0.2, color='#475569')

plt.tight_layout()
plt.show()
Library

Matplotlib

Category

3D Charts

Did this help you?

Support PyLucid to keep it free & growing

Support