This commit is contained in:
Felix Pankratz 2025-07-20 16:09:41 +02:00
parent ec63b97756
commit 04e070ccbb

View File

@ -6,21 +6,28 @@ from PIL import Image
import pyvista as pv
sphere = pv.Tetrahedron()# Sphere()
pl=pv.Plotter(off_screen=True)
pl.add_mesh(sphere, color='tan', show_edges=False)
def main():
sphere = pv.Tetrahedron()# Sphere()
hide_cursor()
y, x = get_position()
print('\n' * 25, end='')
globe = pv.examples.load_globe()
tex = pv.examples.load_globe_texture()
pl=pv.Plotter(off_screen=True)
pl.add_mesh(globe, color='tan', smooth_shading=True, texture=tex, show_edges=False)
frames = []
try:
while True:
pl.camera.Azimuth(1)
image = pl.screenshot(transparent_background=True, window_size=(512, 512))
frames.append(Image.fromarray(image))
set_position(y-25, x)
draw_to_terminal(Image.fromarray(image))
finally:
show_cursor()
hide_cursor()
y, x = get_position()
print('\n' * 25, end='')
frames = []
try:
while True:
pl.camera.Azimuth(1)
image = pl.screenshot(transparent_background=True, window_size=(512, 512))
frames.append(Image.fromarray(image))
set_position(y-25, x)
draw_to_terminal(Image.fromarray(image))
finally:
show_cursor()
if __name__ == '__main__':
main()