diff --git a/simulators/mayavi_simulator.py b/simulators/mayavi_simulator.py index 85b3f62412c1e7203ab2404be84a32475c26a067..5e5c29ca5b59ba375a34aa2f628e6fb277cf88f7 100644 --- a/simulators/mayavi_simulator.py +++ b/simulators/mayavi_simulator.py @@ -1,6 +1,6 @@ # -*- coding:utf-8 -*- -# title : -# description : +# title :Mayavi天体运行模拟器 +# description :Mayavi天体运行模拟器 # author :Python超人 # date :2023-02-11 # link :https://gitcode.net/pythoncr/ @@ -16,6 +16,7 @@ class MayaviSimulator(Simulator): """ Mayavi天体运行模拟器 """ + def __init__(self, bodies_sys: System): super().__init__(bodies_sys, MayaviView) @@ -27,3 +28,18 @@ class MayaviSimulator(Simulator): # Updating scene... f.scene.render() yield + + +if __name__ == '__main__': + from scenes.func import mayavi_run + from bodies import Sun, Earth + from common.consts import SECONDS_PER_WEEK + + """ + 太阳、地球 + """ + bodies = [ + Sun(size_scale=1.2e2), # 太阳放大 120 倍 + Earth(size_scale=4e3, distance_scale=1), # 地球放大 4000 倍,距离保持不变 + ] + mayavi_run(bodies, SECONDS_PER_WEEK) diff --git a/simulators/mpl_simulator.py b/simulators/mpl_simulator.py index b594d00c313ec6940adaa75cc3ca8b9f097ddbc1..beaeb5af1ac71a9171f94e5815789365ff940917 100644 --- a/simulators/mpl_simulator.py +++ b/simulators/mpl_simulator.py @@ -1,6 +1,6 @@ # -*- coding:utf-8 -*- -# title : -# description : +# title :matplotlib天体运行模拟器 +# description :matplotlib天体运行模拟器 # author :Python超人 # date :2023-02-11 # link :https://gitcode.net/pythoncr/ diff --git a/simulators/simulator.py b/simulators/simulator.py index 302ce86fbc5f9cccc5ed0c7b920bf63e20610951..78bd6937ef6e374b6a742673748d7ce71db5fe01 100644 --- a/simulators/simulator.py +++ b/simulators/simulator.py @@ -1,6 +1,6 @@ # -*- coding:utf-8 -*- -# title : -# description : +# title :天体运行模拟器 +# description :天体运行模拟器 # author :Python超人 # date :2023-02-11 # link :https://gitcode.net/pythoncr/ diff --git a/simulators/views/body_view.py b/simulators/views/body_view.py index 0275935d90c93082cb19a2b7d08e03973b163b60..c7d797c5fb3749942635684c471cb879f6799325 100644 --- a/simulators/views/body_view.py +++ b/simulators/views/body_view.py @@ -1,6 +1,6 @@ # -*- coding:utf-8 -*- -# title : -# description : +# title :天体视图 +# description :天体视图(天体效果展示用) # author :Python超人 # date :2023-02-11 # link :https://gitcode.net/pythoncr/ diff --git a/simulators/views/mayavi_view.py b/simulators/views/mayavi_view.py index 2e1cdd86684dcc81e275ffd6fddd4de80b4351f6..8a78bbdc3a5313ef9f4b4381f945539f27a56e28 100644 --- a/simulators/views/mayavi_view.py +++ b/simulators/views/mayavi_view.py @@ -1,6 +1,6 @@ # -*- coding:utf-8 -*- -# title : -# description : +# title :Mayavi天体视图 +# description :Mayavi天体视图(天体效果展示用,需要安装 mayavi) # author :Python超人 # date :2023-02-11 # link :https://gitcode.net/pythoncr/ diff --git a/simulators/views/mpl_view.py b/simulators/views/mpl_view.py index f714e23069e6873e7b983f47376e953dfb74caff..54555e5971939ff2e9e37db15abf3c5e787cea0a 100644 --- a/simulators/views/mpl_view.py +++ b/simulators/views/mpl_view.py @@ -1,6 +1,6 @@ # -*- coding:utf-8 -*- -# title : -# description : +# title :matplotlib天体视图 +# description :matplotlib天体视图(天体效果展示用) # author :Python超人 # date :2023-02-11 # link :https://gitcode.net/pythoncr/