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

Error handling instead of assertions #123

Open
finnbear opened this issue Jan 7, 2025 · 0 comments
Open

Error handling instead of assertions #123

finnbear opened this issue Jan 7, 2025 · 0 comments

Comments

@finnbear
Copy link
Contributor

finnbear commented Jan 7, 2025

#115 (comment): Removing the assert functions from the API. They should likely be only available for testing I suppose. Wouldn't really want to offer functions that crash the program knowingly. We should convert those to proper errors. Maybe use thiserror to ease this a bit.

My thoughts:

  • When possible, inputs should be checked (at least debug_assert! but an error may be preferable), instead of creating an invalid BVH or ray.
    • Decide whether AABB's must have volume. If so, ensure they do.
    • Ensuring numbers are within valid ranges (especially not NaN)
  • Panics should be avoided
  • Essential panics should be documented
  • As an additional debugging tool, there could be a way to export BVH AABB's and ray(s) as a 3D model (.PLY seems easiest), which could be examined in 3D software.
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

1 participant