diff --git a/Application/Modules/msh2.py b/Application/Modules/msh2.py index 2a77bcc..7905b91 100644 --- a/Application/Modules/msh2.py +++ b/Application/Modules/msh2.py @@ -1139,11 +1139,15 @@ def clear_doubles(self): new_vertices_set = set() len_new_verts = 0 + num_cleared_vertices = 0 + for index, vert in enumerate(self.vertices): if vert in new_vertices_set: index_original = new_vertices.index(vert) # Insert into indices map. self.index_map[index] = index_original + + num_cleared_vertices += 1 else: new_vertices.append(vert) new_vertices_set.add(vert) @@ -1151,6 +1155,8 @@ def clear_doubles(self): len_new_verts += 1 self.vertices.vertices = new_vertices + logging.info('Cleared %s doubles.', num_cleared_vertices) + def dump(self, fh): '''Dump information to open filehandler fileh.''' fh.write('\t\t\t--- SegmentGeometry ---\n') @@ -1851,6 +1857,9 @@ def dump(self, fh): fh.write('\t\t\tPos: {0:3}, {1:3}, {2:3}\n'.format(*self.pos)) fh.write('\t\t\tUV: {0:3}, {1:3}\n'.format(*self.uv)) + def __hash__(self): + return hash((self.x, self.y, self.z, self.u, self.v, self.nx, self.ny, self.nz)) + def __eq__(self, other): if (self.x == other.x) and (self.y == other.y) and (self.z == other.z): if (self.u == other.u) and (self.v == other.v): diff --git a/xsizet.ver b/xsizet.ver index b8db934..10f9034 100644 --- a/xsizet.ver +++ b/xsizet.ver @@ -1 +1 @@ -1.3.0030 +1.3.0031