diff options
author | ishbosamiya <ishbosamiya@gmail.com> | 2021-08-06 16:21:13 +0300 |
---|---|---|
committer | ishbosamiya <ishbosamiya@gmail.com> | 2021-08-06 16:21:13 +0300 |
commit | 9de42e703056dc290bde1b79bbf7e4fcddf59dc4 (patch) | |
tree | c04951ec77d0f563690d4afcab556a2cae2496d6 /source | |
parent | fb67bf49412ba5766a871f2b3a62226e67dc2113 (diff) |
adaptive_cloth: mesh: split edge: correct orientation for new face
Set the correct orientation for the new faces formed during the split
edge operation.
By swapping the unwanted vert for the new vert, the orientation is
preserved.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/BKE_cloth_remesh.hh | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/blenkernel/BKE_cloth_remesh.hh b/source/blender/blenkernel/BKE_cloth_remesh.hh index fbe346570eb..90c5a94c0b8 100644 --- a/source/blender/blenkernel/BKE_cloth_remesh.hh +++ b/source/blender/blenkernel/BKE_cloth_remesh.hh @@ -1734,7 +1734,6 @@ template<typename END, typename EVD, typename EED, typename EFD> class Mesh { auto &edge_c = this->get_checked_edge(edge_index); auto &other_vert = this->get_checked_other_vert(edge_c, face); - /* TODO(ish): Ordering of the verts and nodes needs to be found correctly */ /* Handle new face and new edge creation */ { /* Handle new edge creation between new_vert and other_vert */ @@ -1744,9 +1743,10 @@ template<typename END, typename EVD, typename EED, typename EFD> class Mesh { this->add_edge_ref_to_verts(new_edge); auto &new_face_1 = this->add_empty_face(face.normal); - new_face_1.verts.append(edge_vert_1_b.self_index); - new_face_1.verts.append(other_vert.self_index); - new_face_1.verts.append(new_vert.self_index); + /* Set correct orientation by swapping ev2 for nv */ + new_face_1.verts = face.verts; + new_face_1.verts[new_face_1.verts.first_index_of(edge_vert_2_b.self_index)] = + new_vert.self_index; added_faces.append(new_face_1.self_index); /* link edges with new_face_1 */ @@ -1765,9 +1765,10 @@ template<typename END, typename EVD, typename EED, typename EFD> class Mesh { * for loop owns `face` */ auto &new_face_2 = this->add_empty_face(face.normal); - new_face_2.verts.append(other_vert.self_index); - new_face_2.verts.append(edge_vert_2_b.self_index); - new_face_2.verts.append(new_vert.self_index); + /* Set correct orientation by swapping ev1 for nv */ + new_face_2.verts = face.verts; + new_face_2.verts[new_face_2.verts.first_index_of(edge_vert_1_b.self_index)] = + new_vert.self_index; added_faces.append(new_face_2.self_index); /* link edges with new_face_2 */ |