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

MaximumInscribedCircle regression check #1072

Conversation

jodygarnett
Copy link
Contributor

I noticed a small regression when updating to 1.20.0 and created this PR to capture it for discussion.

@dr-jts as shown in this test case MaximumInscribedCircle changed from getCentroid to getInternalPoint. I assume this was expected and produces a better result.

My question is if this change should consider the tolerance provided? The resulting value not longer "snaps" to the expected precision as was previously done...

@jodygarnett jodygarnett added this to the 1.20.0 milestone Aug 26, 2024
@dr-jts
Copy link
Contributor

dr-jts commented Aug 26, 2024

The suggested tests reveal two changes in output. Both of the changes still match the contract of MaximumInscribedCircle, which is an approximation. It's better to condition the unit tests to provide more stable results. The tests use a very coarse tolerance for MaximumInscribedCircle. This produces results which is overly dependent on the algorithm internals (e.g. the switch from centroid to interior point).

The test can use a finer tolerance to get more stable results. It's also an option (as done here) to use a tolerance when checking the expected output - but this doesn't work for cases like testDoubleDiamond where the output is dramatically different.

@jodygarnett
Copy link
Contributor Author

And about the "snapping" to provided tolerance? I was more meaning if the value previously snapped to POINT(15 5) reflecting the provided tolerance.

Did you intend that the new implementation snap to POINT(14 5)? Presently it has far greater precision than anticipated.

@dr-jts
Copy link
Contributor

dr-jts commented Aug 27, 2024

And about the "snapping" to provided tolerance?

The algorithm never provided rounding to the tolerance size. The appearance of this in the old result is just coincidence.

Rounding the result value to reflect the tolerance is a good idea, though.

@jodygarnett
Copy link
Contributor Author

perfect, that is what I wished to confirm.

So the only question is if you want this test case?

@dr-jts
Copy link
Contributor

dr-jts commented Aug 27, 2024

So the only question is if you want this test case?

I don't think so, they are similar to other existing tests.

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

Successfully merging this pull request may close these issues.

2 participants