Solving problem with duplicate vertices in obj mesh in OpenMesh

v 0 0 0                                                                                                                                                                 v 1 0 0                                                                                                                                                                 v 0 1 0                                                                                                                                                                 v 1 1 0                                                                                                                                                                 f 0 1 2                                                                                                                                                                 f 1 2 3
import openmesh as om                                                                                                                                                   import numpy as npmesh_3 = om.read_trimesh('duplicate_vert_test.obj')                                                                                                                     print('Test duplicate vertices')                                                                                                                                                                                                                                                                                                                for i, vh in enumerate(mesh_3.vertices()):                                                                                                                                                                                                                                                                                        
print('Vertices adjacent to vertex ', i)
for vh_n in mesh_3.vv(vh):
print(vh_n.idx())
Vertices adjacent to vertex  0                                                                                                                                          2                                                                                                                                                                       1                                                                                                                                                                       Vertices adjacent to vertex  1                                                                                                                                          0                                                                                                                                                                       2                                                                                                                                                                       Vertices adjacent to vertex  2                                                                                                                                          1                                                                                                                                                                       0                                                                                                                                                                       Vertices adjacent to vertex  3
Vertices adjacent to vertex 4
v 0 0 0                                                                                                                                                                 v 1 0 0                                                                                                                                                                 v 0 1 0                                                                                                                                                                 v 1 1 0                                                                                                                                                                 v 1 0 0                                                                                                                                                                 f 0 1 2                                                                                                                                                                 f 4 2 3
Vertices adjacent to vertex  0                                                                                                                                          Vertices adjacent to vertex  1                                                                                                                                          3                                                                                                                                                                       2
Vertices adjacent to vertex 2 1 3 Vertices adjacent to vertex 3 2 1
Vertices adjacent to vertex 4

Remove vertex duplicates in MeshLab

vn 0.000000 -nan(ind) 0.000000                                                                                                                                          v 0.000000 0.000000 0.000000                                                                                                                                            vn 0.000000 0.000000 -0.785398                                                                                                                                          v 1.000000 0.000000 0.000000                                                                                                                                            vn 0.000000 0.000000 -0.785398                                                                                                                                          v 0.000000 1.000000 0.000000                                                                                                                                            vn 0.000000 0.000000 -1.570796                                                                                                                                          v 1.000000 1.000000 0.000000                                                                                                                                            # 4 vertices, 0 vertices normals                                                                                                                                                                                                                                                                                                                f 4//4 2//2 3//3                                                                                                                                                        # 1 faces, 0 coords texture
Vertices adjacent to vertex  0                                                                                                                                          Vertices adjacent to vertex  1                                                                                                                                          3                                                                                                                                                                       2                                                                                                                                                                       Vertices adjacent to vertex  2                                                                                                                                          1                                                                                                                                                                       3                                                                                                                                                                       Vertices adjacent to vertex  3                                                                                                                                          2                                                                                                                                                                       1

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Getting started with Meilisearch

Django API for Handwritten Digit Recognition

TOP 3 TRENDS FOR MOBILE APP DEVELOPMENT

From Solidity to Ink!, a practical take

What is the Slice and Map Type in Go?

Installing Harbor Registry in Centos 7

8 Open Source Projects for Your Ecommerce Stack

Shell, init files, variables and expansions

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Privalov Vladimir

Privalov Vladimir

More from Medium

WRK Features e RoadMAP

What is blockchain infrastructure?

Building Iinterntheory website from scratch at MASAI School

DMN Runner inputs persistence