3D Fill Between

3D Coiled Cable Structure

Engineering visualization of coiled cable with inner conductor and outer shielding.

Output
3D Coiled Cable Structure
Python
import matplotlib.pyplot as plt
import numpy as np

fig = plt.figure(figsize=(12, 9), facecolor='#ffffff')
ax = fig.add_subplot(111, projection='3d')
ax.set_facecolor('#ffffff')

n = 400
t = np.linspace(0, 12*np.pi, n)
z = np.linspace(0, 6, n)

# Cable structure
r_outer = 1.0 + 0.1 * np.sin(t * 0.5)
r_inner = 0.5 + 0.05 * np.sin(t * 0.5)

x_outer = r_outer * np.cos(t)
y_outer = r_outer * np.sin(t)

x_inner = r_inner * np.cos(t)
y_inner = r_inner * np.sin(t)

ax.plot(x_outer, y_outer, z, linewidth=2.5, color='#6366F1')
ax.plot(x_inner, y_inner, z, linewidth=2, color='#EF4444')

# Insulation layer
for i in range(0, n, 4):
    ax.plot([x_outer[i], x_inner[i]], [y_outer[i], y_inner[i]], [z[i], z[i]], 
            color='#10B981', alpha=0.25, linewidth=0.6)

ax.set_xlabel('X', fontsize=11, color='#1f2937')
ax.set_ylabel('Y', fontsize=11, color='#1f2937')
ax.set_zlabel('Length', fontsize=11, color='#1f2937')
ax.set_title('Coiled Cable Structure', fontsize=14, color='#1f2937', fontweight='bold', pad=15)

ax.tick_params(colors='#374151', labelsize=9)
ax.xaxis.pane.fill = False
ax.yaxis.pane.fill = False
ax.zaxis.pane.fill = False
ax.xaxis.pane.set_edgecolor('#e5e7eb')
ax.yaxis.pane.set_edgecolor('#e5e7eb')
ax.zaxis.pane.set_edgecolor('#e5e7eb')
ax.grid(True, alpha=0.3, color='#d1d5db')

plt.tight_layout()
plt.show()
Library

Matplotlib

Category

3D Charts

Did this help you?

Support PyLucid to keep it free & growing

Support