feat: Implement 3D flight animation methods using Vedo (Issue #523) - #909
Conversation
|
@GuilhermeAsura could you please fix tests and linters on CI? |
I'm on it! |
4a29817 to
aebdf6a
Compare
Gui-FernandesBR
left a comment
There was a problem hiding this comment.
the code coverall looks good, but needs refactor.
We can still add it to the next release (this month)
|
Before we merge this PR, some points should be addressed:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #909 +/- ##
===========================================
+ Coverage 80.27% 81.24% +0.96%
===========================================
Files 104 113 +9
Lines 12769 14814 +2045
===========================================
+ Hits 10250 12035 +1785
- Misses 2519 2779 +260 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
I am working on this one locally |
|
@YuroCastroDev we would love to hear feedbacks from this feature. Do you think you could help us? |
ab5ef3d to
292eadf
Compare
Implement 3D visualization of flight results in the plots layer using the optional `vedo` library, addressing issue #523: - `animate_trajectory`: 6-DOF translation of the rocket relative to ground. - `animate_rotate`: rocket attitude (rotation) evolution during flight. `vedo` is added as an optional dependency under the `[animation]` extra (`pip install rocketpy[animation]`); both methods raise a descriptive ImportError with install instructions when it is missing. A bundled `default_rocket.stl` asset and unit tests for the animation methods are included, along with user docs (flight, installation) and a colab cell. Originally developed by Patrick Sampaio in the legacy `animate_flight` branch and adapted to the current Flight architecture. Co-Authored-By: GuilhermeAsura <gmslazzarini@gmail.com> Co-Authored-By: Gui-FernandesBR <guilherme_fernandes@usp.br> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
292eadf to
a39ec8f
Compare
- Fold the Unreleased section into v1.13.0 and date it 2026-07-19. - Drop reverted PR #958 entries (parachute abstract-base breaking change) and its revert #1063 - neither ever reached a release. - Consolidate the 3D flight animation into a single #1066 (PyVista) entry; drop the superseded Vedo-based #909. - Remove duplicate entries (#1066, #1067, #1055 in Added, #1047 in Added) and the doubled "ENH: ENH:" / "MNT: MNT:" auto-changelog prefixes. - Drop non-user-facing meta entries (#1062 changelog cleanup, #1069 CI fix) and the test-only entry (#1051), per the changelog's own scope rules. - Add the missing #1070 (max_time for StochasticFlight) entry. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The 3D flight animation switched from Vedo (#909) to PyVista (#1066). pyproject.toml was updated (animation extra = pyvista + imageio-ffmpeg) but requirements-optional.txt still pinned the now-unused vedo and was missing the new deps. Drop vedo and add pyvista/imageio-ffmpeg so both dependency sources agree. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… deps sync (#1073) * DOC: consolidate and clean v1.13.0 changelog for release - Fold the Unreleased section into v1.13.0 and date it 2026-07-19. - Drop reverted PR #958 entries (parachute abstract-base breaking change) and its revert #1063 - neither ever reached a release. - Consolidate the 3D flight animation into a single #1066 (PyVista) entry; drop the superseded Vedo-based #909. - Remove duplicate entries (#1066, #1067, #1055 in Added, #1047 in Added) and the doubled "ENH: ENH:" / "MNT: MNT:" auto-changelog prefixes. - Drop non-user-facing meta entries (#1062 changelog cleanup, #1069 CI fix) and the test-only entry (#1051), per the changelog's own scope rules. - Add the missing #1070 (max_time for StochasticFlight) entry. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * MNT: sync optional animation deps in requirements-optional.txt The 3D flight animation switched from Vedo (#909) to PyVista (#1066). pyproject.toml was updated (animation extra = pyvista + imageio-ffmpeg) but requirements-optional.txt still pinned the now-unused vedo and was missing the new deps. Drop vedo and add pyvista/imageio-ffmpeg so both dependency sources agree. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* ENH: `Function` vectorized speed-up and refactor (#1049) * MNT: deduplicate function arithmetic logic. ENH: modularize function arithmetic and source dispatch. MNT: refactor function math modules. MNT: optimize function math speed. * MNT: enhance parachute trigger evaluation for speed. * MNT: improve typing stack on Function evaluation. * MNT: architecture corrections and optimizations. * TST: attempt at tests re-run. * MNT: minor fixes and docstring update. * DOC: Update Changelog for PR #1049 * ENH: Interactive 3D Flight Trajectory and Attitude Animation. (#1066) * ENH: Interactive 3D Flight Trajectory and Attitude Animation. * TST: update actions workflow dependencies for headless run. * MNT: solve plot animation review comments on styling. * DOC: Update Changelog for PR #1066 * MNT: Remove unused pylint disable statements. (#1067) * DOC: Update Changelog for PR #1067 * TST: cover PyVista flight animation helpers and fix docstring Fixes the two CI failures on the develop -> master sync (PR #1068): - DOC/build-docs: the ``color_by`` parameter of ``animate_trajectory`` used the numpydoc ``{...}`` value-set syntax split across two lines, which numpydoc rejects ("invalid value set (missing closing brace)"). Because the docs job builds with ``-W`` (warnings as errors) the build failed. Rewrite the type as a single-line prose description. - codecov/patch and codecov/project: the new PyVista animation subsystem in ``_FlightPlots`` was only exercised by a single minimal off-screen smoke test, leaving the scene builders and the pure geometry/telemetry helpers uncovered. Add unit tests for the render-independent helpers (quaternion rotation, polylines, camera paths, option validation, event markers, telemetry panels, background palette, etc.) and extend the off-screen integration tests to drive the full set of overlays (charts, camera tracking, stability markers, playback controls) and the GIF export path. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VW2VidZmPd93dd8xW8BX2J * DOC: Update Changelog for PR #1069 * ENH: Add optional `max time` to `stochastic_flight` and create `stochastic_flight` objects with attributes in base flight (#1070) * Add max_time option to stochastic_flight * Update: use default attributes in flight object for stochastic flights * Add tests to check attributes * Refactor implementation * MNT: pre-release v1.13.0 cleanup — changelog consolidation + optional deps sync (#1073) * DOC: consolidate and clean v1.13.0 changelog for release - Fold the Unreleased section into v1.13.0 and date it 2026-07-19. - Drop reverted PR #958 entries (parachute abstract-base breaking change) and its revert #1063 - neither ever reached a release. - Consolidate the 3D flight animation into a single #1066 (PyVista) entry; drop the superseded Vedo-based #909. - Remove duplicate entries (#1066, #1067, #1055 in Added, #1047 in Added) and the doubled "ENH: ENH:" / "MNT: MNT:" auto-changelog prefixes. - Drop non-user-facing meta entries (#1062 changelog cleanup, #1069 CI fix) and the test-only entry (#1051), per the changelog's own scope rules. - Add the missing #1070 (max_time for StochasticFlight) entry. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * MNT: sync optional animation deps in requirements-optional.txt The 3D flight animation switched from Vedo (#909) to PyVista (#1066). pyproject.toml was updated (animation extra = pyvista + imageio-ffmpeg) but requirements-optional.txt still pinned the now-unused vedo and was missing the new deps. Drop vedo and add pyvista/imageio-ffmpeg so both dependency sources agree. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * DOC: Update Changelog for PR #1073 --------- Co-authored-by: Pedro Henrique Marinho Bressan <87212571+phmbressan@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: ZuoRen Chen <180084773+zuorenchen@users.noreply.github.com>
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.