34 lines
885 B
Python
34 lines
885 B
Python
#!/usr/bin/env python3
|
|
|
|
from kitty import draw_to_terminal, get_position, set_position, hide_cursor, show_cursor #, draw_animation
|
|
|
|
from PIL import Image
|
|
|
|
import pyvista as pv
|
|
|
|
def main():
|
|
sphere = pv.Tetrahedron()# Sphere()
|
|
|
|
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)
|
|
|
|
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()
|