Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Performing SurfaceRemeshing Adaptive with Features can lead to crashes.
To reproduce the crash do the following
The remeshing project does not work in the latest commit as already reported in Issue
Inheriting from MeshViewer on Windows crashes due to the imgui context being null Inheriting from MeshViewer on Windows crashes due to the imgui context being null #87.
The latest working commit is as far as I know SHA-1: 3145a49
The program will crash because mesh_->halfedge(f) is called with an invalid Face f
The reason for this crash is, that for some degenerated triangles solving minimize_squared_areas lead to an vector containing nan, so one solution is to check at the end of minimize_squared_areas if the solved vector contains invalid values.
By doing so the crash is prevented but it takes a really long time to solve (might be an endless loop).
One solution for this might be to change the function is_too_long, so that an edge is never to long if it is smaller than min_edge_length_.
Motivation
Adaptive surface remeshing with features should not crash
Benefits
no crash
Drawbacks
I am not sure if there is a reason that an edge is currently allowed to be smaller than min_edge_length_, but everything seems to work with the change.
Maybe it would be better to abort the calculation if it is not possible to calculate the minimize_squared_areas.