Skip to content

Fix igl::is_irregular_vertex()#1247

Merged
jdumas merged 5 commits intolibigl:devfrom
BruegelN:fix-is_irregular_vertex
Jul 5, 2019
Merged

Fix igl::is_irregular_vertex()#1247
jdumas merged 5 commits intolibigl:devfrom
BruegelN:fix-is_irregular_vertex

Conversation

@BruegelN
Copy link
Copy Markdown
Contributor

@BruegelN BruegelN commented Jul 4, 2019

Only in DEBUG mode Eigen does all boundary checks when accessing elements.
Thus when using igl::is_irregular_vertex() fails if CMAKE_BUILD_TYPE=Debug.
I've added a test for igl::is_irregular_vertex to showcase that it segfaults with CMAKE_BUILD_TYPE=Debug due to a missing F.maxCoeff()+1 in https://github.com/libigl/libigl/blob/master/include/igl/is_irregular_vertex.cpp#L16 see build https://travis-ci.org/BruegelN/libigl/builds/550519463 (Note only macOS builds with CMAKE_BUILD_TYPE=Debug and it's not related to the recent changes on Travis CI for macOS)
After fixing the off-by-one issue everything works as expected (https://travis-ci.org/BruegelN/libigl/builds/550521102)

Check all that apply (change to [x])

  • All changes meet libigl style-guidelines.
  • Adds new .cpp file.
  • Adds corresponding unit test.
  • Adds corresponding python binding.
  • This is a minor change.

Copy link
Copy Markdown
Collaborator

@jdumas jdumas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! Just got one minor comment.

@jdumas jdumas merged commit ed98693 into libigl:dev Jul 5, 2019
@BruegelN BruegelN deleted the fix-is_irregular_vertex branch July 8, 2019 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants