-
Notifications
You must be signed in to change notification settings - Fork 317
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
[Topology.Container] Add new method computeSegmentTriangleIntersectionInPlane in TriangleSetGeometryAlgorithm #5188
base: master
Are you sure you want to change the base?
Conversation
I think some unit tests would be welcomed, especially for new things like these, introduced in "core" modules. |
type::fixed_array<Vec3, 3> triP = { Vec3(c0[0], c0[1], c0[2]), Vec3(c1[0], c1[1], c1[2]), Vec3(c2[0], c2[1], c2[2]) }; | ||
|
||
// Project A and B into triangle plan | ||
Vec3 v_normal = (triP[2] - triP[0]).cross(triP[1] - triP[0]); |
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.
It changes nothing to the computation afterwards, but isn't this the opposite of the normal ?
e4d76ca
to
2daf7df
Compare
… test adding and removing triangles
…t TriangleSegmentIntersection inside same plane or with projection
Tests have been added but in middle of others changes which have been suggested in PR #5246 |
[ci-build][with-all-tests] |
CI is failing @epernod
|
This has been fixed in #5246 |
Edit: PR based on #5246
This method compute the intersection between a Triangle from the current topology and a Segment [AB] which will be projected in Triangle Frame. Using Segment-Segment intersection from
geometry::Edge::intersectionWithEdge
Return true if there is an intersection otherwise false.
Will fill input variables
sofa::type::vector<EdgeID>& intersectedEdges
andsofa::type::vector<Real>& baryCoefs
with the list of intersected edges (Id in global topology, not relative to the triangle) and the barycoef of the intersection relative to the first vertex of the edge. I.e coordinate of the intersection is: Edge[0] * barycoef + Edge[1] * (1-barycoef )This method will replace
computeSegmentTriangleIntersection
when all the work regarding new incision in triangle using TriangleSubvider is finished.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