Lets learn about the brain
0) & (y < 0) z[mask] -= 1 # Split into left and right hemispheres if side == 'left': x[x > 0] = 0 else: x[x < 0] = 0 return x, y, z def create_cerebellum(a, b, c, resolution=30): u = np.linspace(0, 2 * np.pi, resolution) v = np.linspace(0, np.pi / 2, resolution) x = a * np.outer(np.cos(u), np.sin(v)) y = b * np.outer(np.sin(u), np.sin(v)) z = c * np.outer(np.ones_like(u), np.cos(v)) # Add some deformations x += np.random.normal(0, 0.1, x.shape) y += np.random.normal(0, 0.1, y.shape) z += np.random.normal(0, 0.1, z.shape) return x, y, z - 4 # Shift cerebellum down # Create the brain parts x_left, y_left, z_left = create_hemisphere(10, 8, 6, 'left') x_right, y_right, z_right = create_hemisphere(10, 8, 6, 'right') x_cereb, y_cereb, z_cereb = create_cerebellum(7, 4, 3) # Plot the shape fig = plt.figure(figsize=(12, 10)) ax = fig.add_subplot(111, projection='3d') ax.plot_surface(x_left, y_left, z_left, color='pink', edgecolor='none', alpha=0.7) ax.plot_surface(x_right, y_right, z_right, color='pink', edgecolor='none', alpha=0.7) ax.plot_surface(x_cereb, y_cereb, z_cereb, color='lightpink', edgecolor='none') ax.set_xlabel('X') ax.set_ylabel('Y') ax.set_zlabel('Z') ax.set_title('Detailed Brain Model') ax.set_xlim(-10, 10) ax.set_ylim(-10, 10) ax.set_zlim(-5, 10) plt.show() />Using this project
This is the Glitch Hello Website project. You can use it to build your own site. Check out the code in the editor and open the TODO for next steps!