-
Notifications
You must be signed in to change notification settings - Fork 0
Do not deduplicate single line polygon #65
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
Conversation
WalkthroughThis change modifies the Changes
Sequence Diagram(s)sequenceDiagram
participant F as split_polygon_on_repeated_edges
participant PL as Polygon_List
participant EP as Edge_Processor
PL->>F: Provide polygon
F->>F: Check polygon.size()
alt polygon.size() < 3
F-->>PL: Return polygon as single-element vector
else polygon.size() >= 3
F->>EP: Process polygon to split on repeated edges
EP-->>F: Return processed polygon parts
end
F-->>PL: Return result
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (5)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/PartSegCore_compiled_backend/triangulation/triangulate.hpp (1)
863-877
: Update function documentation to mention 2-point polygon handling.The function documentation should be updated to mention that 2-point polygons are treated as single line segments and are not processed for edge deduplication between their first and last points.
/** * Calculates and returns a list of unique (deduplicated) edges from a list of * polygons. * * This function receives a list of polygons, where each polygon is defined by a * series of points. It identifies the edges of the polygons and returns those * edges that are unique (i.e., edges that appear an odd number of times across * all polygons). Any edge that appears an even number of times is considered to * be a duplicate and is removed. + * + * Note: Polygons with exactly 2 points are treated as single line segments and + * are not processed for edge deduplication between their first and last points. * * @param polygon_list A reference to a vector containing vectors of points, * where each inner vector represents a polygon. * @return A vector of unique edges (of type point::Segment) that are not * duplicated across the polygons. */
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/PartSegCore_compiled_backend/triangulation/triangulate.hpp
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: Test on windows-latest with Python 3.12
- GitHub Check: Test on windows-latest with Python 3.11
- GitHub Check: Test on windows-latest with Python 3.10
- GitHub Check: Test on windows-latest with Python 3.9
🔇 Additional comments (2)
src/PartSegCore_compiled_backend/triangulation/triangulate.hpp (2)
893-893
: LGTM! The change correctly handles 2-point polygons.The addition of
if (polygon.size() == 2) continue;
ensures that 2-point polygons are not processed for edge deduplication between their first and last points. This is correct because a 2-point polygon should be treated as a single line segment without creating an additional edge.
893-893
: Add test coverage for 2-point polygon handling.Please add test cases to verify that:
- 2-point polygons are correctly treated as single line segments
- Edge deduplication works correctly for mixed cases with both 2-point and larger polygons
Summary by CodeRabbit