2

I am currently writing a program where I have a set of points within a 2D plane that I would like to convert to a triangle mesh in such a way, that the mesh has the least number of triangles possible.

Currently I use constrained delaunay triangulation but while it gives me the correctly triangulated mesh, this mesh is not optimal regarding the number of triangles: suboptimal triangulation The mesh above has 11 triangles, but one can trivially see, that it would be possible to triangulate the exact same shape using only 7 triangles as seen below: optimal triangulation

My question is: Is there an algorithm, that can optimize the mesh derived from constrained delaunay triangulation as demonstrated above and if so can you please explain it shortly?

If there is no way to postprocess the mesh, is it possible to either filter the point cloud beforehand, or to use a different algorithm for triangulation, which will return the optimal triangulation by default?

  • One thing you can do is to check for co-linearity. All the points in your example which are corner-points to "unnecessary triangles" are on lines which include more than two points. – mathreadler Nov 13 '22 at 19:16
  • Yes, I also noticed that. However I am not sure what to do with these points. I can not get rid of them before performing the triangulation, because this leads to another shape. – frankenapps Nov 13 '22 at 20:03
  • You can try to let the ones on the end points of lines containing more than two points build the largest triangles they can first. In general case you probably want to sort for how many points on line and start with the end points of lines with highest number of points on them. – mathreadler Nov 13 '22 at 20:22
  • It's important to note that your 7 triangles do not constitute what is typically understood as a triangle mesh. Adjacent triangles no longer share edges. I'd even be reluctant to call your 7 triangle example a triangulation. The folklore term for ill-behaved triangle set is "triangle soup", but I wouldn't go that far. However, this is just a quibble about terminology .. your question still stands. But since your question is "is there and algorithm", I'd wager the answer the answer may be "no" because it would convert a mesh to a non-mesh. – brainjam Nov 14 '22 at 20:48
  • Ok, I’m fine with calling it a triangle soup. So I guess in that case I am looking for an algorithm to convert a set of points to a contiguous triangle soup with the least amount of triangles possible. It’s unfortunate for me that there seems to be no such algorithm, as I would have been able to optimize around 30% of vertecies away in my current use case. – frankenapps Nov 18 '22 at 19:10

0 Answers0