///
/// Merges overlapping faces, edges and vertices.
///
/// # Error
///
/// Returns an error if the merging will result in a non-manifold mesh.
///
Merges overlapping faces, edges and vertices.
Merges overlapping faces edges and vertices .
pub fn merge_overlapping_primitives(&mut self) -> Result<(), Error>
    {
        let set_of_vertices_to_merge = self.find_overlapping_vertices();
        let set_of_edges_to_merge = self.find_overlapping_edges(&set_of_vertices_to_merge);
        let set_of_faces_to_merge = self.find_overlapping_faces(&set_of_vertices_to_merge);
        for faces_to_merge in set_of_faces_to_merge {
            let mut iter = faces_to_merge.iter();
            iter.next();
            for face_id2 in iter {
                self.remove_face_unsafe(*face_id2);
            }
        }
        for vertices_to_merge in set_of_vertices_to_merge {
            let mut iter = vertices_to_merge.iter();
            let mut vertex_id1 = *iter.next().unwrap();
            for vertex_id2 in iter {
                vertex_id1 = self.merge_vertices(vertex_id1, *vertex_id2)?;
            }
        }
        for edges_to_merge in set_of_edges_to_merge {
            let mut iter = edges_to_merge.iter();
            let mut edge_id1 = *iter.next().unwrap();
            for edge_id2 in iter {
                edge_id1 = self.merge_halfedges(edge_id1, *edge_id2)?;
            }
        }
        self.fix_orientation();
        Ok(())
    }
pub fn merge_overlapping_primitives ( & mut self ) -> Result < ( ) , Error > { let set_of_vertices_to_merge = self . find_overlapping_vertices ( ) ; let set_of_edges_to_merge = self . find_overlapping_edges ( & set_of_vertices_to_merge ) ; let set_of_faces_to_merge = self . find_overlapping_faces ( & set_of_vertices_to_merge ) ; for faces_to_merge in set_of_faces_to_merge { let mut iter = faces_to_merge . iter ( ) ; iter . next ( ) ; for face_id2 in iter { self . remove_face_unsafe ( * face_id2 ) ; } } for vertices_to_merge in set_of_vertices_to_merge { let mut iter = vertices_to_merge . iter ( ) ; let mut vertex_id1 = * iter . next ( ) . unwrap ( ) ; for vertex_id2 in iter { vertex_id1 = self . merge_vertices ( vertex_id1 , * vertex_id2 ) ? ; } } for edges_to_merge in set_of_edges_to_merge { let mut iter = edges_to_merge . iter ( ) ; let mut edge_id1 = * iter . next ( ) . unwrap ( ) ; for edge_id2 in iter { edge_id1 = self . merge_halfedges ( edge_id1 , * edge_id2 ) ? ; } } self . fix_orientation ( ) ; Ok ( ( ) ) }
Merges overlapping faces, edges and vertices.
Merges overlapping faces edges and vertices .
&mut self
error
Returns an error if the merging will result in a non-manifold mesh.
Returns an error if the merging will result in a non - manifold mesh .