WIP: Vertex reflection along a plane #129
Draft
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.
Description
Work in progress proposal to add supporting methods to reflect
Mesh
andPolygon
vertices along a givenPlane
.This is currently a partial implementation as the reflected vertex normal yields incorrect results.
Discussion
I have implemented the appropriate methods for reflecting the vertex positions but the calculations used to determine the reflected normal of the plane are currently incorrect. This is most likely due to my lack of comprehension of the concepts discussed here and how this should be implemented. This requires further discussion.
The ordering of the polygon vertices is reversed using
.inverted()
which I believe to be correct but this feels a little like a code smell. Reversing the ordering feels intuitive to me as the polygons are mirrored 🤷♂️Basic coverage for reflecting a quad has been added to the unit test suite but this will likely need additional tests for polygons which are coplanar / intersecting. I will bolster these further if there is any interest in merging this PR.