Skip to content

Commit

Permalink
use triple intersection
Browse files Browse the repository at this point in the history
  • Loading branch information
sloriot committed Nov 12, 2024
1 parent 0823238 commit 0a44740
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ create_single_source_cgal_program("test_corefinement_and_constraints.cpp")
create_single_source_cgal_program("test_corefinement_and_constraints_nearest.cpp")
create_single_source_cgal_program("test_corefinement_bool_op.cpp")
create_single_source_cgal_program("test_corefine.cpp")
create_single_source_cgal_program("snap_and_corefinement_union.cpp")
create_single_source_cgal_program("test_coref_epic_points_identity.cpp")
create_single_source_cgal_program("test_does_bound_a_volume.cpp")
create_single_source_cgal_program("test_pmp_clip.cpp")
Expand Down Expand Up @@ -88,6 +87,8 @@ if(TARGET CGAL::Eigen3_support)
target_link_libraries(test_decimation_of_planar_patches PUBLIC CGAL::Eigen3_support)
create_single_source_cgal_program("remeshing_quality_test.cpp" )
target_link_libraries(remeshing_quality_test PUBLIC CGAL::Eigen3_support)
create_single_source_cgal_program("snap_and_corefinement_union.cpp")
target_link_libraries(snap_and_corefinement_union PUBLIC CGAL::Eigen3_support)
else()
message(STATUS "NOTICE: Tests that use the Eigen library will not be compiled.")
endif()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,17 +303,13 @@ void coregularize(MeshRange meshes, FT epsilon, FT angle, FT reg_epsilon, FT reg
const EPlane_3& second = to_exact(*it++);
const EPlane_3& third = to_exact(*it++);

const auto inter = CGAL::intersection(first, second);
CGAL_assertion(bool(inter));
ELine_3 l;
if (!CGAL::assign(l, inter))
continue;
const auto inter2 = CGAL::intersection(l, third);
const auto inter = CGAL::intersection(first, second, third);
EPoint_3 p;
ELine_3 l;

if (CGAL::assign(p, inter2))
if (CGAL::assign(p, inter))
m.point(v) = from_exact(p);
else if (CGAL::assign(l, inter2))
else if (CGAL::assign(l, inter))
m.point(v) = from_exact(l.projection(to_exact(m.point(v))));
}
else {
Expand Down Expand Up @@ -370,7 +366,10 @@ int main(int argc, char* argv[])
//std::vector<Mesh> meshes = load_folder("C:/Data/Unite");
coregularize(meshes, epsilon, 90.0, epsilon, 0.1, true, true, CGAL::Epick());

/*PMP::experimental::surface_snapping(mesh1, mesh2, epsilon);
// PMP::experimental::surface_snapping(mesh1, mesh2, epsilon);

std::ofstream("reg_m1.off") << std::setprecision(17) << mesh1;
std::ofstream("reg_m2.off") << std::setprecision(17) << mesh2;

Mesh out;
bool valid_union = PMP::corefine_and_compute_union(mesh1,mesh2, out);
Expand All @@ -380,7 +379,7 @@ int main(int argc, char* argv[])
std::cout << "Union was successfully computed\n";
CGAL::IO::write_polygon_mesh("snap_union.off", out, CGAL::parameters::stream_precision(17));
return 0;
}*/
}

std::cout << "Union could not be computed\n";

Expand Down

0 comments on commit 0a44740

Please sign in to comment.