Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Polyscope example.
name: polyscope
channels:
- conda-forge
- default
dependencies:
- python>=3.6
- numpy
- scipy
- matplotlib>=2.0
- polyscope
- pip
- pip:
- meshzoo
import numpy as np
import meshzoo
import polyscope as ps
from scipy.special import sph_harm
points, cells = meshzoo.iso_sphere()
x, y, z = points.T
phi = np.arctan2(y, x)
theta = np.arctan2(np.sqrt(x**2 + y**2), z)
vertex_scalar = sph_harm(2, 3, theta, phi)
#%% Visualización
ps.init()
ps.register_surface_mesh("my mesh", points, cells)
# ps.get_surface_mesh("my mesh").add_scalar_quantity("my_scalar",
# z, defined_on='vertices', cmap='viridis')
ps.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment