Increasing mesh details (additional tesselation)

48 views Asked by At

I have the following problem (as a part of a solutions to another problem :)). I have a triangulated mesh with some triangles marked. It is needed to split marked triangles to a four smaller ones like this:

   /\             /\
  /  \           /__\
 /    \   -->   /\  /\
/______\       /__\/__\

That splitting of marked triangles leads to the need to splittriangles adjacent to marked ones too (one is marked, another's just adjacent and the last remained intact):

    ____               ____
   /\   |\            /\  /|\
  /  \  | \          /__\/ | \
 /    \ |  \  -->   /\  /\ |  \
/______\|___\      /__\/__\|___\

Is there some C/C++ library that can be useful for it? Also, it is useful to keep adjacency data, so it would be nice to update that adjacency data after splitting. It would be nice, even if the library does not do the job, if it provides a convenient interface to work with that kind of data (triangles, adjacency).

1

There are 1 answers

0
Jadh4v On BEST ANSWER

Check out VTK C++ library. It has a class vtkPolyData that can handle the operations that you mention. Particular member functions to check out:

  • InsertNextLinkedCell
  • InsertNextLinkedPoint
  • ReplaceLinkedCell

Read the linked documentation page to understand how to use it. The class can be used for any type of cells, not just triangles. But you can restrict your use to just triangles.