27#ifndef EASY_ALGO_EXT_OVERLAPPING_FACES_H
28#define EASY_ALGO_EXT_OVERLAPPING_FACES_H
36#include <CGAL/Simple_cartesian.h>
37#include <CGAL/intersections.h>
38#include <CGAL/box_intersection_d.h>
40#include <easy3d/core/surface_mesh.h>
66 std::vector<std::pair<SurfaceMesh::Face, SurfaceMesh::Face > > &duplicate_faces,
67 std::vector<std::pair<SurfaceMesh::Face, SurfaceMesh::Face > > &folding_faces,
68 double dist_threshold = 1e-6
83 bool folding_faces =
false,
84 double dist_threshold = 1e-6
88 typedef CGAL::Simple_cartesian<double> Kernel;
90 typedef CGAL::Point_3<Kernel> Point_3;
91 typedef CGAL::Vector_3<Kernel> Vector_3;
92 typedef CGAL::Triangle_3<Kernel> Triangle_3;
97 Triangle(
const Point_3& a,
const Point_3& b,
const Point_3& c,
SurfaceMesh::Face f) : triangle(a, b, c), face(f) {}
100 std::vector<SurfaceMesh::Vertex> vertices;
104 typedef std::vector<Triangle> Triangles;
105 typedef typename Triangles::iterator TrianglesIterator;
106 typedef CGAL::Box_intersection_d::Box_with_handle_d<double, 3, TrianglesIterator> Box;
109 Triangles mesh_to_cgal_triangle_list(
SurfaceMesh* esh);
112 enum OverlapType {OT_NONE, OT_SAME, OT_FOLDING};
113 OverlapType do_overlap(
const Triangle& A,
const Triangle& B,
double sqr_eps);
115 Triangles triangle_faces_;
Detects/Removes duplicate and folding faces for a triangle mesh.
Definition: overlapping_faces.h:48
unsigned int remove(SurfaceMesh *mesh, bool folding_faces=false, double dist_threshold=1e-6)
Removes duplicate faces and and folding faces.
Definition: overlapping_faces.cpp:188
void detect(SurfaceMesh *mesh, std::vector< std::pair< SurfaceMesh::Face, SurfaceMesh::Face > > &duplicate_faces, std::vector< std::pair< SurfaceMesh::Face, SurfaceMesh::Face > > &folding_faces, double dist_threshold=1e-6)
Detects duplicate faces and folding faces.
Definition: overlapping_faces.cpp:143
A halfedge data structure for polygonal meshes of 2-manifold.
Definition: surface_mesh.h:52
Definition: collider.cpp:182
Definition: surface_mesh.h:134