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: add condition to handle_imperfect_touch #1346

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

barendgehrels
Copy link
Collaborator

Fixes #1345

Difference was wrong for both cases, caused by nearly opposite segments. The condition causing this had to be finetuned with an extra check.

Fixed behaviour:
a (p=big polygon containing all, q=small rectangle at top which subtly overlaps p)

Difference a-b (in image, this should be a rectangle, correct)
image

Difference b-a -> 0 (correct)

b (p = u-shape, q = the lower bar of it, subtly overlapping p)

Difference a-b (in image, this should be the two vertical bars of the u, correct)
Difference b-a -> 0 (correct)

image

@barendgehrels barendgehrels added this to the 1.87 milestone Nov 20, 2024
@barendgehrels barendgehrels self-assigned this Nov 20, 2024
@@ -66,12 +73,6 @@ struct side_calculator
inline int pk_wrt_q2() const { return m_side_strategy.apply(get_qj(), get_qk(), get_pk()); }
inline int qk_wrt_p2() const { return m_side_strategy.apply(get_pj(), get_pk(), get_qk()); }

// Necessary when rescaling turns off:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Moved above to order i, j, k

@@ -674,6 +682,7 @@ struct touch : public base_turn_handler
{
if (side_qk_p1 == 0 && side_pk_q1 == 0
&& has_pk && has_qk
&& opposite(side.pi_wrt_q1(), side.qk_wrt_p2())
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the fix

static std::string issue_1345_a[2] =
{
// Needs check for opposite in handle_imperfect_touch
R""""(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@vissarion this is (AFAIK) the first case written in this new multi-line format.
It doesn't have all those quotes and reflects the reported case.
Like it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error in difference (extracted from #1241)
1 participant