Merge branch 'triangulate_copy_properties' into 'master'
Copy per-halfedge and per-face properties to new elments during triangulation This is an attempt to fix an issue we encountered when loading a textured quad mesh and triangulating it: In the triangulated version, the respective values of the per-halfedge texcoords and face texture index properties were not assigned to the new triangles that were created during triangulation. See merge request !57
This commit is contained in:
@@ -1032,6 +1032,7 @@ void PolyConnectivity::triangulate(FaceHandle _fh)
|
||||
|
||||
HalfedgeHandle base_heh(halfedge_handle(_fh));
|
||||
VertexHandle start_vh = from_vertex_handle(base_heh);
|
||||
HalfedgeHandle prev_heh(prev_halfedge_handle(base_heh));
|
||||
HalfedgeHandle next_heh(next_halfedge_handle(base_heh));
|
||||
|
||||
while (to_vertex_handle(next_halfedge_handle(next_heh)) != start_vh)
|
||||
@@ -1051,6 +1052,10 @@ void PolyConnectivity::triangulate(FaceHandle _fh)
|
||||
set_face_handle(next_heh, new_fh);
|
||||
set_face_handle(new_heh, new_fh);
|
||||
|
||||
copy_all_properties(prev_heh, new_heh, true);
|
||||
copy_all_properties(prev_heh, opposite_halfedge_handle(new_heh), true);
|
||||
copy_all_properties(_fh, new_fh, true);
|
||||
|
||||
base_heh = opposite_halfedge_handle(new_heh);
|
||||
next_heh = next_next_heh;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user