MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / run

Method run

tools/SelfIntersection/IGL/IGLSelfIntersectionResolver.cpp:11–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9using namespace PyMesh;
10
11void IGLSelfIntersectionResolver::run() {
12 typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
13 typedef Eigen::Matrix<Kernel::FT, Eigen::Dynamic, Eigen::Dynamic,
14 Eigen::RowMajor> MatrixEr;
15 igl::copyleft::cgal::RemeshSelfIntersectionsParam param;
16 MatrixEr out_vertices;
17 MatrixIr out_faces;
18 MatrixIr intersecting_face_pairs;
19 VectorI unique_vertex_indices;
20
21 igl::copyleft::cgal::remesh_self_intersections(
22 m_vertices,
23 m_faces,
24 param,
25 out_vertices,
26 out_faces,
27 intersecting_face_pairs,
28 m_face_sources,
29 unique_vertex_indices);
30
31 std::for_each(out_faces.data(),out_faces.data()+out_faces.size(),
32 [&unique_vertex_indices](int & a){
33 a=unique_vertex_indices(a);
34 });
35
36 MatrixEr final_vertices;
37 igl::remove_unreferenced(out_vertices,out_faces,
38 final_vertices,m_faces,unique_vertex_indices);
39
40 m_vertices.resize(final_vertices.rows(), final_vertices.cols());
41 std::transform(final_vertices.data(), final_vertices.data() +
42 final_vertices.rows() * final_vertices.cols(), m_vertices.data(),
43 [](const Kernel::FT& val) { return CGAL::to_double(val); });
44}
45
46#endif

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected