Created
May 20, 2020 20:46
-
-
Save nicoguaro/29f794faebcc77da94a4c517d934ed11 to your computer and use it in GitHub Desktop.
Polyscope example.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: polyscope | |
channels: | |
- conda-forge | |
- default | |
dependencies: | |
- python>=3.6 | |
- numpy | |
- scipy | |
- matplotlib>=2.0 | |
- polyscope | |
- pip | |
- pip: | |
- meshzoo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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