From f74359050948c7d1e5e58f4a1f713026ef900475 Mon Sep 17 00:00:00 2001 From: Wang YB <94800665+Gradbb@users.noreply.github.com> Date: Mon, 20 May 2024 14:20:34 +0800 Subject: [PATCH] update test_layer_region --- src/libslic3r/LayerRegion.cpp | 4 ++-- src/libslic3r/LayerRegion.hpp | 29 +++++++++++++++++++++++---- tests/libslic3r/test_layer_region.cpp | 21 +++++++++++++++++-- 3 files changed, 46 insertions(+), 8 deletions(-) diff --git a/src/libslic3r/LayerRegion.cpp b/src/libslic3r/LayerRegion.cpp index 1be7f66..45891db 100644 --- a/src/libslic3r/LayerRegion.cpp +++ b/src/libslic3r/LayerRegion.cpp @@ -616,14 +616,14 @@ Surfaces expand_bridges_detect_orientations(Surfaces & } //w36 -static Surfaces expand_merge_surfaces(Surfaces & surfaces, + Surfaces expand_merge_surfaces(Surfaces & surfaces, SurfaceType surface_type, ExPolygons & shells, const Algorithm::RegionExpansionParameters &expansion_params_into_solid_infill, ExPolygons & sparse, const Algorithm::RegionExpansionParameters &expansion_params_into_sparse_infill, const float closing_radius, - const double bridge_angle = -1.) + const double bridge_angle ) { using namespace Slic3r::Algorithm; diff --git a/src/libslic3r/LayerRegion.hpp b/src/libslic3r/LayerRegion.hpp index a03c5b2..17ffb98 100644 --- a/src/libslic3r/LayerRegion.hpp +++ b/src/libslic3r/LayerRegion.hpp @@ -205,23 +205,44 @@ struct ExpansionZone { * detect bridges. * Trim "shells" by the expanded bridges. */ -Surfaces expand_bridges_detect_orientations( +// w36 +/* Surfaces expand_bridges_detect_orientations( Surfaces &surfaces, std::vector& expansion_zones, const float closing_radius -); +);*/ + +//w36 +Surfaces expand_bridges_detect_orientations(Surfaces & surfaces, + ExPolygons & shells, + const Algorithm::RegionExpansionParameters &expansion_params_into_solid_infill, + ExPolygons & sparse, + const Algorithm::RegionExpansionParameters &expansion_params_into_sparse_infill, + const float closing_radius); /** * Extract bridging surfaces from "surfaces", expand them into "shells" using expansion_params. * Trim "shells" by the expanded bridges. */ -Surfaces expand_merge_surfaces( + +// w36 +/* Surfaces expand_merge_surfaces( Surfaces &surfaces, SurfaceType surface_type, std::vector& expansion_zones, const float closing_radius, const double bridge_angle = -1 -); +);*/ + +// w36 +Surfaces expand_merge_surfaces(Surfaces & surfaces, + SurfaceType surface_type, + ExPolygons & shells, + const Algorithm::RegionExpansionParameters &expansion_params_into_solid_infill, + ExPolygons & sparse, + const Algorithm::RegionExpansionParameters &expansion_params_into_sparse_infill, + const float closing_radius, + const double bridge_angle = -1.); } diff --git a/tests/libslic3r/test_layer_region.cpp b/tests/libslic3r/test_layer_region.cpp index 0f6dfb7..02f7640 100644 --- a/tests/libslic3r/test_layer_region.cpp +++ b/tests/libslic3r/test_layer_region.cpp @@ -75,13 +75,26 @@ struct LayerRegionFixture { TEST_CASE_METHOD(LayerRegionFixture, "test the surface expansion", "[LayerRegion]") { const double custom_angle{1.234f}; - const Surfaces result{expand_merge_surfaces( + // w36 + /* const Surfaces result{expand_merge_surfaces( surfaces, stBottomBridge, expansion_zones, closing_radius, custom_angle + )};*/ + + // w36 + const Surfaces result{expand_merge_surfaces( + surfaces, stBottomBridge, + shells, + expansion_params_into_solid_infill, + sparse, + expansion_params_into_sparse_infill, + closing_radius )}; + + if constexpr (export_svgs) { SVG svg("general_expansion.svg", BoundingBox{ Point{scaled(-3.0), scaled(-1.0)}, @@ -112,9 +125,13 @@ TEST_CASE_METHOD(LayerRegionFixture, "test the surface expansion", "[LayerRegion } TEST_CASE_METHOD(LayerRegionFixture, "test the bridge expansion with the bridge angle detection", "[LayerRegion]") { + // w36 Surfaces result{expand_bridges_detect_orientations( surfaces, - expansion_zones, + shells, + expansion_params_into_solid_infill, + sparse, + expansion_params_into_sparse_infill, closing_radius )};