Created
April 30, 2020 13:25
-
-
Save stiklaz/39ee8ecf6827d25502900831d9f3e3aa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void CMeshOp::Test() | |
{ | |
Surface_mesh mesh_end_1; | |
std::fstream file_end_1("mesh_end1.off"); | |
file_end_1 >> mesh_end_1; | |
Surface_mesh mesh_end_2; | |
std::fstream file_end_2("mesh_end2.off"); | |
file_end_2 >> mesh_end_2; | |
Surface_mesh mesh_main; | |
std::fstream file_to_cut("mesh_main.off"); | |
file_to_cut >> mesh_main; | |
Surface_mesh mesh_with_cut1; | |
const bool bFirstCut = CGAL::Polygon_mesh_processing::corefine_and_compute_difference(mesh_main, mesh_end_1, mesh_with_cut1, CGAL::parameters::throw_on_self_intersection(true)); | |
Surface_mesh mesh_result; | |
const bool bSecondCut = CGAL::Polygon_mesh_processing::corefine_and_compute_difference(mesh_with_cut1, mesh_end_2, mesh_result, CGAL::parameters::throw_on_self_intersection(true)); | |
if (bFirstCut) { | |
std::ofstream file_result_1cut("mesh_with_cut1.off"); | |
if (file_result_1cut.is_open()) { | |
file_result_1cut << mesh_with_cut1; | |
file_result_1cut.close(); | |
} | |
} | |
if (bSecondCut) { | |
std::ofstream file_result_2cuts("mesh_result.off"); | |
if (file_result_2cuts.is_open()) { | |
file_result_2cuts << mesh_result; | |
file_result_2cuts.close(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment