Skip to content

Instantly share code, notes, and snippets.

@nicoguaro
Created May 20, 2020 20:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nicoguaro/29f794faebcc77da94a4c517d934ed11 to your computer and use it in GitHub Desktop.
Save nicoguaro/29f794faebcc77da94a4c517d934ed11 to your computer and use it in GitHub Desktop.
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