-
Notifications
You must be signed in to change notification settings - Fork 441
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 Circle to remove singular edge #3710
Conversation
all edges of the circle should have apporx the same length
This will not change the total number of points, but the spacing of theta given: Circle(resolution=4) Now: theta = [0, 90, 180, 270] delta_theta = [90, 90, 90] Was: theta = [0, 120, 260, 360] delta_theta = [120, 120, 120]
Codecov Report
@@ Coverage Diff @@
## main #3710 +/- ##
=======================================
Coverage 94.04% 94.04%
=======================================
Files 83 83
Lines 18641 18641
=======================================
Hits 17530 17530
Misses 1111 1111 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for fixing this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for fixing this.
Good catch on the issue, thanks @GlennWSo. Just to muse a bit about the choice we have to make when fixing the bug: either keep the number of non-degenerate edges, or keep the number of actual edges. This PR chose the latter, which means that visually the result will change, and so will the point coordinates, but the size of the mesh will be the same. I'd be tempted to think that opting to keep the number of non-degenerate edges (i.e. sticking with a triangle for Anyway, the documentation of the helper clearly states that
So the current PR's choice is a clear bug-fix that makes the function behave according to the API. Another question is whether this merits a [breaking-change] label... I'm only wondering about this because this will introduce subtle changes with no warning to end users. |
Agree, this change will brake some code. Im sure of this since this will brake some of my own code. Maybe we can make a warning somehow? But im not sure how to best communicate this change to the end user. |
My opinion: keep the changes as is but add a "breaking change" label to this PR so it shows up in the next release notes. We could add a note in the docstring that prior to version 0.38, this method had incorrect results, which are now fixed. I don't want to throw a warning though |
I agree and added the "breaking change" label. If @GlennWSo can add a section in the PR description describing the breaking change, then I think this meets the ability for users to find this change 'easily'. Then it is ready to merge IMO. |
Sure, i can do that and include an example. |
ae1a71c
This made me look through some other geometric objects and I found 2 others with wrong 'circular resolutions': I believe the fix for these is the same as for |
Help wantedim now struggling to pass the gh action build documentation. |
@GlennWSo, the errors/warnings are burried deep in the build logs. These are what I initially saw that will need to be changed here:
|
Commits
Overview
Fixing bugg in pv.Circle.
See linked issue below, for a more detailed bugg description:
resolves #3709
Breaking Change:
This change can break functions depending on pyvista.Circle
Example of broken function:
The fallowing function works with current pyvista, but with the suggested changes it will be broken.
With the changes, the hexagon function will incorrectly create a 7-sided polygon.
With the suggested pyvista changes, the hexagon implementation would need too be updated like so:
Details
now prints:
old prints:
plots
new
old