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

Boolean difference causes panic: segment not found #1193

Open
prideout opened this issue Jun 24, 2024 · 6 comments
Open

Boolean difference causes panic: segment not found #1193

prideout opened this issue Jun 24, 2024 · 6 comments

Comments

@prideout
Copy link

In this new unit test, a panic is provoked by calling difference. The error message looks like this:

thread 'algorithm::bool_ops::tests::test_issue_1104' panicked at geo/src/algorithm/sweep/vec_set.rs:29:14:
segment not found in active-vec-set: 2

Here's the new regression test:

prideout@632d152

This might be related to #1104?

At Arcol we're quite vested in Geo, and we ran into this with one of our customers.

@lnicola
Copy link
Member

lnicola commented Jun 24, 2024

Does it work with f64? I suspect there's a reason why other libraries use double precision.

@prideout
Copy link
Author

Yes this test passes with f64.

@michaelkirk
Copy link
Member

The issue in #913 is equally possible for any floating point representation, but less probable as precision increases.

I'm not sure if this issue is the same underlying cause as #913.

@lnicola
Copy link
Member

lnicola commented Jun 24, 2024

Right, it can still happen, but it does make sense to use higher than input precision for computation. Not an elegant solution, but worth considering.

@prideout
Copy link
Author

Understood, we'll change our codebase to use f64.

For some context, we're currently using f32 only because we're generating vertex buffer data that gets fed into WebGL, and out of laziness we're avoiding a f64 => f32 conversion step.

@prideout
Copy link
Author

Update: unfortunately we can still easily reproduce a similar panic after changing our codebase to use 64-bit precision.

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

No branches or pull requests

3 participants