One vertex removed issue

Hi,
we are having an issue with ExplodeAtUnweldedEdges with some meshes. In our tool we generate meshes for editing the UV coordinate, similar to what happens in the UV editor in Rhino. We therefore manipulate the mesh and then write back the texture coords to the original object.

The issue we are having is that when using ExplodeAtUnweldedEdges the mesh that is returned has one vertex less than the original one (hence triggering exceptions and inconsistencies within the tool). I have a simple reproducer that I am attaching to the topic, simply execute the python script on the given file. The input mesh as 1127 vertices and the result 1126.

Mesh_ExplodeIssue.3dm (58.3 KB)
mesh_issue.py (285 Bytes)

Am I doing something wrong? Thanks a lot,
Alberto

Hi @Alberto,

Try this:

mesh_id = rs.GetObject()
mesh = rs.coercemesh(mesh_id)
print mesh.Vertices.Count
mesh.Compact()
print mesh.Vertices.Count

This is why…

– Dale

Hi Dale,
so I should compact the mesh before processing it? The mesh comes out from the GetObject() that way. Would I need to do that to reliably process the mesh?

Thanks a lot,
Alberto

Hi @Alberto,

In general, no. But not knowing how the mesh was created, it seems necessary in this case.

– Dale

Hi Dale,
the mesh comes from the unwrapping of an existing mesh. The vertices are replaced but the rest of the topology is preserved. We basically duplicate the input and replace just the vertex positions

Alberto