-
Notifications
You must be signed in to change notification settings - Fork 312
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
[Geometry] Add methods getBarycentricCoordinates and isPointInTriangle in Triangle class #4053
[Geometry] Add methods getBarycentricCoordinates and isPointInTriangle in Triangle class #4053
Conversation
[ci-build][with-all-tests] |
Do you know why the function is not removed in the other code? |
For the moment, the old method is not removed because it was not well handling all cases. Therefor the new method has a slightly different (better) behavior. Switching to the new one might cause some scene regressions to fail. I prefer to do that in a next PR. For the TriangleSetGeometryAlgorithm clean, you can create an issue if you want but it is already a wip on my dev branch: See https://github.com/epernod/sofa/pull/10/files#diff-e1443ad8032ebc3d01202980477d0fd24cf3c4db16a90452dd51f780bffe2e3f |
typename T = std::decay_t<decltype(*std::begin(std::declval<Node>()))>, | ||
typename = std::enable_if_t<std::is_scalar_v<T>> | ||
> | ||
static constexpr auto pointBaryCoefs(const Node& p0, const Node& n0, const Node& n1, const Node& n2) |
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.
pointBaryCoefs
, the name looks... not really informative and uses abbreviations.
Maybe something like getBarycentricCoefficients()
or even getBarycentricCoordinates()
which seems more in par with the maths
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.
Done and add more description on the method (based from wikipedia)
…e in Triangle class (sofa-framework#4053)
Add method:
By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).
Reviewers will merge this pull-request only if