-
Notifications
You must be signed in to change notification settings - Fork 74
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
Fix coplanar check #973
Fix coplanar check #973
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one refactor suggestion
Reviewed 3 of 3 files at r1, all commit messages.
Reviewable status: 1 change requests, 0 of 1 approvals obtained (waiting on @andrewheumann)
Elements/src/Geometry/Vector3Extensions.cs
line 24 at r1 (raw file):
int p1Index = -1; int p2Index = -1; for (int i = 1; i < points.Count; i++)
might be nice to pull this first step out into it's own method. FirstThreeNonCollinearIndices
Maybe even TryGetThreeNonCollinearIndices
which would let you retrun true below without additional checks, but that might be messy with out variables etc...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 1 change requests, 0 of 1 approvals obtained (waiting on @wynged)
Elements/src/Geometry/Vector3Extensions.cs
line 24 at r1 (raw file):
Previously, wynged (Eric Wassail) wrote…
might be nice to pull this first step out into it's own method.
FirstThreeNonCollinearIndices
Maybe evenTryGetThreeNonCollinearIndices
which would let you retrun true below without additional checks, but that might be messy with out variables etc...
OK, did my best... I think it's still a little ugly, but it works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: complete! 1 of 1 approvals obtained
Elements/src/Geometry/Vector3Extensions.cs
line 24 at r1 (raw file):
Previously, andrewheumann (Andrew Heumann) wrote…
OK, did my best... I think it's still a little ugly, but it works.
wfm!
BACKGROUND:
DESCRIPTION:
Vector3.EPSILON
— the dot product lends itself nicely to the interpretation of "check that the points are within EPSILON distance of a plane passing through the first three non-coplanar points"TESTING:
REQUIRED:
CHANGELOG.md
.This change is