Skip to content

Commit cfe4850

Browse files
committed
fixed bug related to welded v. unwelded
1 parent ba18e54 commit cfe4850

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/compas/files/obj.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ def write_meshes(self):
508508
else:
509509
self._write_vertices(mesh)
510510
self._write_faces(mesh)
511-
self._v += mesh.number_of_vertices()
511+
self._v += mesh.number_of_vertices()
512512

513513
def _write_vertices(self, mesh):
514514
for key in mesh.vertices():
@@ -524,14 +524,13 @@ def _write_faces(self, mesh):
524524
self.file.write('f {0}\n'.format(vertices_str))
525525

526526
def _write_vertices_and_faces(self, mesh):
527-
index = 0 + self._v
528527
for face in mesh.faces():
529528
vertices = mesh.face_vertices(face)
530529
indices = []
531530
for vertex in vertices:
532531
x, y, z = mesh.vertex_coordinates(vertex)
533532
self.file.write(self.vertex_tpl.format(x, y, z))
534-
indices.append(index)
535-
index += 1
533+
indices.append(self._v)
534+
self._v += 1
536535
indices_str = ' '.join([str(i) for i in indices])
537536
self.file.write('f {0}\n'.format(indices_str))

0 commit comments

Comments
 (0)