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 geometry bug in is_straight_line_drawing #412

Merged

Conversation

jeremy-murphy
Copy link
Contributor

@jeremy-murphy jeremy-murphy commented Dec 27, 2024

Fix the geometry bug uncovered and documented by @Hermann-SW by replacing the custom function with one from Boost.Geometry.
crosses meets the requirement described in the old code for returning true for 'intersections' that don't include endpoints or self-intersection.
I decided to remove the tolerance altogether on the assumption that it was indicative of a poor implementation.

Hermann-SW and others added 4 commits October 12, 2024 19:35
"crosses" fits the requirement as it means that the interior parts of the
geometry share some common points, not exterior parts such as
end-points, and it means "not within".
@pdimov
Copy link
Member

pdimov commented Dec 30, 2024

Why is this assigned to me?

@jeremy-murphy
Copy link
Contributor Author

Why is this assigned to me?

Sorry I meant to leave a comment that I just wanted you to give it a sanity check. I've never used the numeric_cast before, but I presume it's as simple as this.

@jeremy-murphy
Copy link
Contributor Author

I just don't really know who else to assign my own pull requests to, since I assume JZ Maddock wants to minimise his Boost workload these days.

@jeremy-murphy jeremy-murphy force-pushed the 388_is_straight_line_drawing branch from 689eb04 to 9176040 Compare January 1, 2025 22:36
@jeremy-murphy
Copy link
Contributor Author

Whoops, accidentally pushed my CMake changes here and force-pushed to get rid of them.

Copy link

@Becheler Becheler left a comment

Choose a reason for hiding this comment

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

The implementation aligns well with the general style and structure of the Boost Graph Library.

The introduction of a new dependency on Boost::Geometry was briefly discussed in issue #388 and deemed worthwhile during that discussion.

The function is well-organized but remains somewhat lengthy despite the effective code reduction by @jeremy-murphy. While I recognize that adding further function extraction, comments, or documentation could help new contributors better understand the context and usage, I understand that this is not the primary focus of this quick fix.

The code appears correct, and all tests pass; however, I am not deeply familiar with planar graph theory. It might be beneficial for someone with more expertise in this area to provide additional input, though @jeremy-murphy’s expertise may already suffice.

In summary, the tests pass, and the code is consistent with the library's conventions. While I may not be fully qualified to evaluate the deeper theoretical aspects, I’m happy to assist further if needed!

@jeremy-murphy jeremy-murphy merged commit 84c36ca into boostorg:develop Jan 26, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants