Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Bug in the face order check#1394

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
adamant-pwn merged 4 commits intocp-algorithms:mainfromhazzlerr:patch-1
Jan 13, 2025
Merged

Conversation

hazzlerr
Copy link
Contributor

Current check for a polygon order is incorrect, and it breaks on the following test:

Screenshot 2024-11-15 181100
Here's the code that generates this test:

vector<Point> pts = {{0,2}, {1,3}, {0,1}, {1,0}, {-1,0}, {-1,3}};vector<vector<size_t>>adj(pts.size());auto add_edge = [&](int u,int v) {    adj[u].push_back(v);    adj[v].push_back(u);};add_edge(0,1);add_edge(1,2);add_edge(2,3);add_edge(3,4);add_edge(4,5);add_edge(5,0);

For an outer face (1→2→3→4→5→0), the previous version of the algorithm would first check the triplet 1→2→3. Since this triplet is ordered in counter-clockwise order, it would incorrectly mark this face as inner.

So, instead we should use something different. I used the oriented area, however, since the coordinates are stored as int64_t, I had to use __int128, which doesn't feel that elegant.

@hazzlerrhazzlerr changed the titleFixed face order checkBug in the face order checkNov 20, 2024
@adamant-pwnadamant-pwn merged commit2ebecc1 intocp-algorithms:mainJan 13, 2025
Bhaskar1312 pushed a commit to Bhaskar1312/cp-algorithms that referenced this pull requestApr 19, 2025
* Fixed face order check* Update test_planar_faces.cpp
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@jakobkoglerjakobkoglerAwaiting requested review from jakobkogler

@adamant-pwnadamant-pwnAwaiting requested review from adamant-pwn

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@hazzlerr@adamant-pwn

[8]ページ先頭

©2009-2025 Movatter.jp