-
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
[Topology] Check indices out-of-bound in TriangleSetTopologyContainer #4242
Conversation
|
|
1 similar comment
|
{ | ||
msg_warning() << "trianglesAroundVertex creation failed, Triangle buffer is not concistent with number of points: Triangle: " << m_triangle[i] << " for: " << getNbPoints() << " points."; | ||
continue; | ||
} |
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.
should the componentState be invalid then?
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.
should it not break the loop ?
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 could yes! I just copy-pasted (included the typo on consistent!) what was done from EdgeSetTopologyContainer where there is exactly the same loop but for edges.
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.
glups..
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.
what? My télor is riche! 😆
...ainer/Dynamic/src/sofa/component/topology/container/dynamic/TriangleSetTopologyContainer.cpp
Outdated
Show resolved
Hide resolved
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.
Ok for me, but could you explain in which case you have this problem?
Setting the component to invalid is a good idea. Breaking the loop might create some bigger issue in components using the topology as it won't be set.
We have this problem when using subtopologies defined using BoxROIs. The subTopo has fewer points than the original topology (Since it is a subset of it) but the triangles in that subtopo refer to nodes indexed with the numbering in the original topology that are out of bounds within the subtopo world. Not sure that is clear! |
But for the component state set to invalid, I would actually leave it valid. |
There is something un-catholic there... So if I understand well, you have triangle in your topology that refer to point out of bound to your current node mechanicalObject? |
Small up regarding Erik's question @olivier-goury your answer will help us deciding whether we pass the component as invalid or not in the loop |
@olivier-goury could you try using a SubSetTopologyMapping to ignore out of the box triangles? |
Sorry for the late reply! |
I switched this PR back to "to review". It was in WIP, that's why the lack of activity. @epernod can you take a look on @olivier-goury 's answer? |
ok for me if it fix your case and it had a warning if we encounter the wrong behavior. |
[ci-build][with-all-tests] |
…Array (Like it is done in EdgeSetTopologyContainer for EdgeAroundVertexArray)
390f842
to
575c4c7
Compare
…#4242) * Check that triangles index match the size of the triangleAroundVertexArray (Like it is done in EdgeSetTopologyContainer for EdgeAroundVertexArray) * Fix some typos
Check that triangles index match the size of the triangleAroundVertexArray (Like it is done in EdgeSetTopologyContainer for EdgeAroundVertexArray)
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