feat(edit): add spline-based angle interpolation to context menu#14
Merged
fwrise merged 1 commit intoApr 15, 2026
Merged
Conversation
Add a right-click context menu action 'Spline interpolate angles...' that fits a cubic spline to a vehicle's bounding box trajectory and orients all bounding box angles along the spline tangent. Features: - Two modes: entire trajectory or user-specified frame range - Configurable smoothing factor (splprep s= parameter, default 0.0) - Warning confirmation dialog before overwriting existing angles - Fully undoable via Ctrl+Z (SplineAngleCommand) - Handles stationary vehicles (repeated positions) via forward-fill - 19 new unit tests for spline math and annotation service integration Architecture (MVC pattern): - InterpolationService: pure-math spline_interpolate_angles() static method - AnnotationService: apply_spline_angle_interpolation() orchestration - AnnotationController: @error_handler wrapper - AnnotationGateway: protocol + ControllerAnnotationGateway extension - SplineAngleCommand: undoable command with before/after geometry snapshots - SplineAngleDialog: QDialog with mode selection, smoothing config, warning - Context menu integration via _annotation_spline_ops.py Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Note
This is the PR analogous to the one for
markit, #13, only this one enables it foreditas wellAdd a right-click context menu action "Spline interpolate angles…" to the
editapplication that fits a cubic spline to a vehicle's bounding box trajectory and orients all bounding box angles along the spline tangent.Features
splpreps=parameter, default 0.0)SplineAngleCommand)Architecture (MVC pattern)
interpolation_service.pyspline_interpolate_angles()static methodannotation_service.pyapply_spline_angle_interpolation()orchestrationannotation_controller.py@error_handlerwrappergateways.pycommands.pySplineAngleCommandwith geometry snapshotsspline_angle_dialog.py_annotation_spline_ops.pyTests
19 new unit tests covering:
All 144 edit tests pass. Lint clean.
Dependencies
Added
scipy>=1.10.0to theeditdependency group (already present formarkit).