44from rocket_stl import create_rocket_stl
55from rocket_setup import get_calisto_rocket
66
7+
78def run_simulation_and_test_animation ():
89 print ("🚀 Setting up simulation (Calisto Example)..." )
9-
10+
1011 # 1. Setup Environment
1112 env = Environment (latitude = 32.990254 , longitude = - 106.974998 , elevation = 1400 )
1213 env .set_date ((2025 , 12 , 5 , 12 ))
@@ -23,40 +24,40 @@ def run_simulation_and_test_animation():
2324 test_flight = Flight (
2425 rocket = calisto , environment = env , rail_length = 5.2 , inclination = 85 , heading = 0
2526 )
26-
27+
2728 print (f"✅ Flight simulated successfully! Apogee: { test_flight .apogee :.2f} m" )
2829
2930 # 4. Test Animation Methods
3031 stl_file = "rocket_model.stl"
31- # Note: Depending on where you run this, you might need to adjust imports
32+ # Note: Depending on where you run this, you might need to adjust imports
3233 # or ensure create_rocket_stl is available in scope.
3334 create_rocket_stl (stl_file , length = 300 , radius = 50 )
3435
3536 print ("\n 🎥 Testing animate_trajectory()..." )
36-
37+
3738 try :
3839 test_flight .animate_trajectory (
39- file_name = stl_file ,
40+ file_name = stl_file ,
4041 stop = 15.0 ,
4142 time_step = 0.05 ,
42- azimuth = - 45 , # Rotates view 45 degrees left
43+ azimuth = - 45 , # Rotates view 45 degrees left
4344 elevation = 30 , # Tilts view 30 degrees up
44- zoom = 1.2
45- )
45+ zoom = 1.2 ,
46+ )
4647 print ("✅ animate_trajectory() executed successfully." )
4748 except Exception as e :
4849 print (f"❌ animate_trajectory() Failed: { e } " )
4950 traceback .print_exc ()
5051
5152 print ("\n 🔄 Testing animate_rotate()..." )
52-
53+
5354 try :
5455 test_flight .animate_rotate (
55- file_name = stl_file ,
56+ file_name = stl_file ,
5657 time_step = 1.0 ,
57- azimuth = - 45 , # Rotates view 45 degrees left
58+ azimuth = - 45 , # Rotates view 45 degrees left
5859 elevation = 30 , # Tilts view 30 degrees up
59- zoom = 1.2
60+ zoom = 1.2 ,
6061 )
6162 print ("✅ animate_rotate() executed successfully." )
6263 except Exception as e :
@@ -67,5 +68,6 @@ def run_simulation_and_test_animation():
6768 if os .path .exists (stl_file ):
6869 os .remove (stl_file )
6970
71+
7072if __name__ == "__main__" :
71- run_simulation_and_test_animation ()
73+ run_simulation_and_test_animation ()
0 commit comments