-
-
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
Add SurfaceVertex
#1048
Merged
Merged
Add SurfaceVertex
#1048
+306
−106
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some code needs to deal with vertices in surface coordinates. Approximation is a current example of that, but there will be more in the future. Calculating these surface coordinates is a bit of an error-prone process, for the same reason that calculating global coordinates is an error-prone process: Surface coordinates that are supposed to be the same can be slightly different, due to floating-point accuracy. By having a `SurfaceVertex`, we're forcing code that creates vertices to calculate those surface coordinates once, and then they are available to all other code that deals with these vertices. This once-at-creation calculation can then benefit from all the protections that are available for the construction of objects (right now, this is the validation infrastructure, but more can be done in the future).
I'm not completely sure if this actually makes a difference, but I think it can rule out some weird edge cases, where global vertices are coincident because the surface connects to itself.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add a new form of vertices,
SurfaceVertex
, which is defined in 2D surface coordinates. Citing from one of the commit messages:The trade-off is complexity, but I think the added reliability (which isn't realized, since
SurfaceVertex
isn't included in validation yet) is worth it. Another way to view this change is that it doesn't add complexity, but just makes the inherent complexity explicit.It would be a bit of a pay-off to update the curve approximation code to not re-compute the surface coordinates. But that would require some more changes there, and I felt that this pull request is already big enough.