import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
# More Pringle-like curvature
a = 3 # curvature in x-direction
b = 6 # curvature in y-direction
height_scale = 0.3 # flatten the chip
# Generate a finer grid
x = np.linspace(-5, 5, 300)
y = np.linspace(-5, 5, 300)
x, y = np.meshgrid(x, y)
# Hyperbolic paraboloid, scaled to look like a chip
z = height_scale * ((x**2) / a**2 - (y**2) / b**2)
# Mask edges to make it oval like a chip
mask = (x**2)/25 + (y**2)/25 < 1
x, y, z = x[mask], y[mask], z[mask]
# Plotting
fig = plt.figure(figsize=(10, 6))
ax = fig.add_subplot(111, projection='3d')
# Use a chip-like color
ax.plot_trisurf(x, y, z, cmap='copper', edgecolor='none', linewidth=0)
# Set view and aesthetics
ax.view_init(elev=30, azim=45)
ax.set_xlim(-5, 5)
ax.set_ylim(-5, 5)
ax.set_zlim(-1, 1)
ax.axis('off')
ax.set_title("Pringles")
plt.tight_layout()
plt.show()