first crack at adding edges between new verts

This commit is contained in:
Stephen M. McQuay 2012-06-22 21:10:15 -07:00
parent dee1889d81
commit 719bc94e8c

View File

@ -1,5 +1,7 @@
from __future__ import division from __future__ import division
from itertools import combinations
from surf.geometry import PolygonMesh, Vertex from surf.geometry import PolygonMesh, Vertex
@ -57,4 +59,10 @@ def refine(mesh):
new_edge = [evid, new_vert_id] new_edge = [evid, new_vert_id]
new_edges.append(new_edge) new_edges.append(new_edge)
for fid in range(len(mesh.faces)):
# join all new edge points on a face:
new_edges.extend(
[[i[0] + nv_offset, i[1] + nv_offset]
for i in combinations(mesh.edges_for_face[fid], 2)])
return PolygonMesh(new_verts, new_faces, new_edges) return PolygonMesh(new_verts, new_faces, new_edges)