feat: Implement 3D flight animation methods using Vedo (Issue #523) #909
+602
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull request type
Checklist
black rocketpy/ tests/) has passed locallypytest tests -m slow --runslow) have passed locallyCHANGELOG.mdhas been updated (if relevant)Current behavior
Currently, the
Flightclass lacks built-in methods for 3D visualization of the simulation results. Users wishing to visualize the rocket's trajectory or attitude must export data and use external tools or write custom scripts. This addresses Issue #523.New behavior
This PR integrates 3D visualization capabilities directly into the
Flightclass using thevedolibrary.Key Changes:
Flight:animate_trajectory(file_name, start, stop, time_step): Visualizes the 6-DOF translation of the rocket relative to the ground.animate_rotate(file_name, start, stop, time_step): Visualizes the specific attitude (rotation) of the rocket during flight.vedoas an optional dependency inpyproject.tomlunder the[animation]key.pip install rocketpy[animation].vedoand raise a descriptiveImportErrorwith installation instructions if it is missing.animate_flightbranch to match the currentFlightclass structure (e.g., removing deprecatedpostProcesscalls).Breaking change
Additional information
Acknowledgements
This feature was originally developed by Patrick Sampaio in the
animate_flightbranch. This PR adapts that work to the moderndevelopbranch structure and newer RocketPy architecture.Verification
A modular verification suite was added in
tests/animation_verification/to generate a dummy 3D model and test the invocation of the animation methods.