Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exporting grid data to 3D model #414

Open
Debnathopu opened this issue Dec 9, 2023 · 0 comments
Open

Exporting grid data to 3D model #414

Debnathopu opened this issue Dec 9, 2023 · 0 comments

Comments

@Debnathopu
Copy link

Debnathopu commented Dec 9, 2023

Hi, I am trying the basic examples of Shtools.
for my purpose, I need the output 3D model preferably in .stl format
Here is the snap of the example
If anyone could help me.
regards,
opu

import matplotlib.pyplot as plt
import pyshtools as pysh

pysh.utils.figstyle(rel_width=0.75)

lmax = 40 # This determines the spatial resolution of the gridded data and 3d image
clm = pysh.SHCoeffs.from_zeros(lmax)
clm.coeffs[0, 10, 0] = 1.
grid = clm.expand()
#grid.to_file('test.dat')
fig, ax = grid.plot3d(show=False) # show=False is used to avoid a warning when plotting in inline mode

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant