Repository navigation
Handle calm and invalid GRAMM wind in section drawing - #95
Closed
Borealis-Thoon wants to merge 2 commits into
Closed
Borealis-Thoon wants to merge 2 commits into
Borealis-Thoon wants to merge 2 commits into
Conversation
Member
|
Thank you very much for all your hard work; we had never noticed this bug before, probably because we rarely use the section view. Other bugs have been fixed in the current development branch, V2701. |
Member
|
I solved the problem, there are just a view lines of codes changed, see commit a95e6de |
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.
A GRAMM section crossing a cell with u = v = 0 can throw OverflowException when Vector3D.AngleBetween returns NaN and the arrow length is converted to Int32. The change uses direct projection, validates drawing values, and displays a warning when invalid vectors are omitted. It retains the Windows unsigned transverse colour convention and displays vertical-only wind.
Following the review, I compared this with a Windows build using only the legacy MONO angle code. Yes, Math.Atan2(0, 0) avoids the reported calm-wind exception. That candidate passes six synthetic comparison cases and five sections from the example 00021.wnd. It still throws on NaN wind and excessive scaling, and its signed transverse component changes the Windows colour convention. Direct projection gives the same finite along-section component without the angle conversion and trigonometry, so I retained the guards and added the MONO comparison to the regression suite.
The base is now V2701. The PR contains only drawing code and tests; it is independent of the source-group work.
Validation on Windows/.NET 10.0.9:
Reproduction instructions
Tests call actual paint functions offscreen. Linux/Mono runtime execution, the reported .NET 10.0.12 environment, and every interactive workflow remain untested. Normal finite-vector results are equivalent within floating-point rounding; exact pixel identity is not a general guarantee. This contribution changes no upstream version labels or source-group behavior.