Merge cuts by CGAL model -- Not Working

This commit is contained in:
Filip Sykala 2022-06-24 15:55:11 +02:00
parent a865fbf3b1
commit b059d3a57c
4 changed files with 999 additions and 338 deletions

File diff suppressed because it is too large Load Diff

View File

@ -42,6 +42,10 @@ using SurfaceCuts = std::vector<SurfaceCut>;
/// <param name="sc_add">Surface cut to consume</param> /// <param name="sc_add">Surface cut to consume</param>
void append(SurfaceCut &sc, SurfaceCut &&sc_add); void append(SurfaceCut &sc, SurfaceCut &&sc_add);
// call private function with same name to test it
bool merge_intersection(SurfaceCut &sc1, const SurfaceCut &sc2);
/// <summary> /// <summary>
/// Merge surface cuts int one /// Merge surface cuts int one
/// </summary> /// </summary>

View File

@ -104,7 +104,7 @@ static Emboss::OrthoProject create_projection_for_cut(
return Emboss::OrthoProject(tr, project_direction); return Emboss::OrthoProject(tr, project_direction);
} }
TEST_CASE("CutSurface in 3mf", "[]") TEST_CASE("CutSurface in 3mf", "[Emboss]")
{ {
std::string path_to_3mf = "C:/Users/filip/Downloads/MultiObj.3mf"; std::string path_to_3mf = "C:/Users/filip/Downloads/MultiObj.3mf";
@ -154,6 +154,11 @@ TEST_CASE("CutSurface in 3mf", "[]")
cut_projection_tr, shape_scale, get_extents(shapes), z_range); cut_projection_tr, shape_scale, get_extents(shapes), z_range);
float projection_ratio = -z_range.first / (z_range.second - z_range.first); float projection_ratio = -z_range.first / (z_range.second - z_range.first);
cut_surface(its, shapes, projection, projection_ratio); SurfaceCut cut = cut_surface(its, shapes, projection, projection_ratio);
its_write_obj(cut, "C:/data/temp/cutSurface/result_cut.obj");
}
TEST_CASE("Merge Cuts", "[Emboss]") {
Slic3r::merge_intersection();
} }
#endif // DEBUG_3MF #endif // DEBUG_3MF

View File

@ -2,6 +2,7 @@ get_filename_component(_TEST_NAME ${CMAKE_CURRENT_LIST_DIR} NAME)
add_executable(${_TEST_NAME}_tests add_executable(${_TEST_NAME}_tests
${_TEST_NAME}_tests_main.cpp ${_TEST_NAME}_tests_main.cpp
slic3r_jobs_tests.cpp slic3r_jobs_tests.cpp
test_cutSurfaceJob.cpp
) )
target_link_libraries(${_TEST_NAME}_tests test_common libslic3r_gui libslic3r) target_link_libraries(${_TEST_NAME}_tests test_common libslic3r_gui libslic3r)