Commit 00728a93 authored by Jan Möbius's avatar Jan Möbius
Browse files

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
parents 50994e81 c7b64add
Pipeline #1591 passed with stage
......@@ -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;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment