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