Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix mesh centroid when coordinates are very big #40757

Merged
merged 2 commits into from Jan 1, 2021

Conversation

vcloarec
Copy link
Member

@vcloarec vcloarec commented Dec 25, 2020

When coordinates are very big, the method for calculating centroid of face leads to big offset when coordinates are big number, this is due to rounding errors.
This PR fixes this issue.

@vcloarec vcloarec added backport release-3_16 BROKEN - YOU MUST DIY!!! Bug Either a bug report, or a bug fix. Let's hope for the latter! Mesh Related to general mesh layer handling (not specific data formats) labels Dec 25, 2020
@github-actions github-actions bot added this to the 3.18.0 milestone Dec 25, 2020
Copy link
Contributor

@PeterPetrik PeterPetrik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does we have any tests for this piece of code?

src/core/mesh/qgstriangularmesh.cpp Outdated Show resolved Hide resolved
@vcloarec
Copy link
Member Author

does we have any tests for this piece of code?

centroids were not directly tested, test added now.

@nyalldawson nyalldawson merged commit ee6d797 into qgis:master Jan 1, 2021
nyalldawson pushed a commit that referenced this pull request Jan 1, 2021
@nyalldawson
Copy link
Collaborator

Manually backported as 9a60b47

@vcloarec
Copy link
Member Author

vcloarec commented Jan 1, 2021

Manually backported as 9a60b47

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Mesh Related to general mesh layer handling (not specific data formats)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants