-
-
Notifications
You must be signed in to change notification settings - Fork 119
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
Vertex validation #242
Comments
I've started working on this. |
I've landed quite a few pull request preparing for vertex validation, and I even have a pull request that implements it (#278). I can't merge it, unfortunately, because it turns out there are lots of dodgy pieces of code that create invalid vertices, and forcing vertex validation would basically mean that every model stops working. I knew that there were some of those problems, which is why I wanted to implement vertex validation in the first place, before making too many other mistakes. But man, the problem is so much worse than I thought. I'm glad I started working on this when I did. So, all that dodgy code needs to be fixed before vertex validation can be merged. Unfortunately, I found that this is not easy. The problem is, that the way shapes are represented is so redundant and easy to get wrong, that writing correct code that works with shapes is almost too hard to be feasible. I actually opened an issue to address this (#280) earlier today, thinking I'd need to be working on this some time soon-ish. Well, turns out that soon-ish is right now. Further work on this issue is therefore paused for the time being, until #280 has been addressed. |
#280 has been wrapped up. I'm back to working on this issue directly. |
Due to floating-point accuracy issues, it is possible get slightly different floating point values, even though those should be the same. This is a pervasive problem. Instead of relying on workarounds, which would be required in every piece of code that touches floating point values, even indirectly through points, vectors, vertices, etc, I've opted to address this problem at an architectural level. See #78 for some context, or the documentation on vertex uniqueness.
I'm reasonably happy with that approach so far, but it's time to take the next step: Validating that all vertices are actually unique. Here's how I imagine that should happen:
I think with this approach, we can keep the kernel code simple and correct (no workaround required; floating point values can just be compared directly), while still reliably catching any problems arising from floating point accuracy issues. This comes at the cost of requiring the user to uphold the design rule that different vertices must not share points. It's likely we'll need to provide specific tools for that, for example if the user wants to transform a body such that it would share vertices with another body at the new position.
I think this is a worthwhile trade-off, as the alternative is code that is hard to make reliable, and that will blog up in the user's face as soon as they create a model that is untypically small (making the epsilon value too big) or untypically large (making the epsilon value too small).
The text was updated successfully, but these errors were encountered: