emerald-geomodelling/EmeraldTriangles

Additional validation checks of triangles

Duke-of-Lizard opened this issue · 0 comments

Motivation

I keep having headaches with using emeraldtriangles because I try to run a process that involves adding triangles to an existing mesh, the process fails but does not return an error message. I know that this is the cause in supplant_triangles because the external function triangle.triangulate fails without throwing an error; instead, the inputs are simply returned. (I suspect there may be a similar issue with scipy.spatial.Delaunay in replace_triangles). Almost every time, I find that the error is caused by some issue in the triangulation that I give as input. It might be overlapping triangles, triangles with 0 area, duplicate vertices, and many other things. But it takes me ages to dig and uncover these issues.

goal

make a standard set of validations and checks, and warn users of potential issues with their triangulation.

running list of checks to run and implement

  • triangles with 0 area
  • duplicate vertices
  • overlapping points and vertices
  • overlapping triangles (this one might be hard to implement)

other requirements

  • Rather than throwing a warning at the first validation check, I recommend doing all the tests, then throwing a warning giving details for all the ways the triangulation is invalid. One triangulation can fail multiple validation tests above.
  • Maybe we should have a setting where if there is a cleanup function to address one of the issues above, we run the cleanup on the function?
    • For example, for cases with duplicated vertices and points, we could use the function emeraldtriangles.cleanup.remove_overlapping_points_vertices.
    • one complication: some cleanup functions have keyword parameters whose default value is not always appropriate (e.g., "keep" for remove_overlapping_points_vertices). Where does the user set those parameter values for the auto-run cleanup after validation checks?