[vtkusers] Create a correct mesh from set of triangles and wrong vertices index numbers

Cory Quammen cory.quammen at kitware.com
Wed Jan 4 15:01:01 EST 2017


On Fri, Dec 23, 2016 at 5:02 AM, gocarlos <gocarlos at ethz.ch> wrote:
> Dear VTK Users
>
> I have some data sets which have several triangles (set of 3 points with x,
> y, z) and vertices. (like the OBJ file).
> The problem is that the vertices are just in increasing order and not
> ordered.

I'm not sure what you mean by "are just in increasing order". Do you
mean that each triangle has a unique set of three vertices and the
vertices are listed in the order the cells are listed?

> Using PCL I've seen that when I save my PCL mesh (with unordered vertices)
> into STL, the PCL library converts the PCL mesh in VTK polydata and then a
> STL file is written to the file system (using VTK).
>
> I tried to look in the source code after the method which vtk used to clean
> the mesh to reorder the vertices, but I haven't found anything.

vtkCleanPolyData would be useful:
http://www.vtk.org/doc/nightly/html/classvtkCleanPolyData.html

> I'm only interested on how VTK orders the vertices in such a way, that they
> are in the right order and the points of the mesh are not duplicate.
> Is there a method to clean the mesh/connect the duplicate points/reorder the
> vertices index?

See this example that does what you want:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/CleanPolyData

- Cory

> Thanks in advance.
>
>
>
> --
> View this message in context: http://vtk.1045678.n5.nabble.com/Create-a-correct-mesh-from-set-of-triangles-and-wrong-vertices-index-numbers-tp5741637.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers



-- 
Cory Quammen
Staff R&D Engineer
Kitware, Inc.


More information about the vtkusers mailing list