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

optionally use majority rather than unanimous ray consensus #32

Closed
wants to merge 10 commits into from

Conversation

clbarnes
Copy link
Owner

@clbarnes clbarnes commented Mar 17, 2023

Configurable number of rays which need to hit backfaces for point to be considered internal.

@clbarnes clbarnes changed the title use majority rather than unanimous ray consensus optionally use majority rather than unanimous ray consensus Mar 20, 2023
@clbarnes clbarnes marked this pull request as ready for review March 20, 2023 15:34
@clbarnes
Copy link
Owner Author

clbarnes commented Mar 20, 2023

Currently implemented as an int number of rays, and an int number of those rays which must hit backfaces, defaulting to all of them (this allows short-circuiting). Could instead ask for a proportion, although as we're generally using small numbers of rays, that would probably only ever be defined in reference to the number of rays anyway.

Alternatively, the rust backend could just report the proportion of rays hitting backfaces (prevents short-circuiting, but that's probably not a big concern) and the caller could do the thresholding themselves.

I wondered whether having the rays' angles be better distributed might be a good idea with this bug, in case there were cases where they were all pointing in more or less the same direction. It's commented out for now, but there is an implementation of having the first ray be truly random, the 2nd be random but orthogonal, and the 3rd completing the basis, then the next 3 being the inverse of that basis (these could also be interleaved). Then the next 6 would be another random basis and its inverse, etc.. This could probably be improved by evenly distributing rays for however many rays there are - e.g. random and inverse for 2, random planar vectors at 120deg from each other for 3, tetrahedral for 4 etc.. But also, this probably doesn't make much difference.

@clbarnes
Copy link
Owner Author

Superceded by #36

@clbarnes clbarnes closed this Jan 10, 2024
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

Successfully merging this pull request may close these issues.

1 participant