Skip to content

Commit

Permalink
Fix/Disable some tests after Removal of ensure vertical shell thickne…
Browse files Browse the repository at this point in the history
…ss option
  • Loading branch information
Godrak committed Mar 3, 2023
1 parent bc58a57 commit de09af2
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 77 deletions.
36 changes: 18 additions & 18 deletions tests/fff_print/test_fill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,24 +312,24 @@ SCENARIO("Infill only where needed", "[Fill]")

double tolerance = 5; // mm^2

GIVEN("solid_infill_below_area == 0") {
config.opt_float("solid_infill_below_area") = 0;
WHEN("pyramid is sliced ") {
auto area = test();
THEN("no infill is generated when using infill_only_where_needed on a pyramid") {
REQUIRE(area < tolerance);
}
}
}
GIVEN("solid_infill_below_area == 70") {
config.opt_float("solid_infill_below_area") = 70;
WHEN("pyramid is sliced ") {
auto area = test();
THEN("infill is only generated under the forced solid shells") {
REQUIRE(std::abs(area - 70) < tolerance);
}
}
}
// GIVEN("solid_infill_below_area == 0") {
// config.opt_float("solid_infill_below_area") = 0;
// WHEN("pyramid is sliced ") {
// auto area = test();
// THEN("no infill is generated when using infill_only_where_needed on a pyramid") {
// REQUIRE(area < tolerance);
// }
// }
// }
// GIVEN("solid_infill_below_area == 70") {
// config.opt_float("solid_infill_below_area") = 70;
// WHEN("pyramid is sliced ") {
// auto area = test();
// THEN("infill is only generated under the forced solid shells") {
// REQUIRE(std::abs(area - 70) < tolerance);
// }
// }
// }
}

SCENARIO("Combine infill", "[Fill]")
Expand Down
4 changes: 2 additions & 2 deletions tests/fff_print/test_perimeters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -556,9 +556,9 @@ SCENARIO("Perimeters3", "[Perimeters]")

GIVEN("V shape, unscaled") {
int n = test(Vec3d(1., 1., 1.));
// except for the two internal solid layers above void
// One bridge layer under the V middle and one layer (two briding areas) under tops
THEN("no overhangs printed with bridge speed") {
REQUIRE(n == 1);
REQUIRE(n == 2);
}
}
GIVEN("V shape, scaled 3x in X") {
Expand Down
116 changes: 59 additions & 57 deletions tests/fff_print/test_shells.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,63 +147,65 @@ SCENARIO("Shells (from Perl)", "[Shells]") {
REQUIRE(n == 3);
}
}
GIVEN("V shape") {
// we need to check against one perimeter because this test is calibrated
// (shape, extrusion_width) so that perimeters cover the bottom surfaces of
// their lower layer - the test checks that shells are not generated on the
// above layers (thus 'across' the shadow perimeter)
// the test is actually calibrated to leave a narrow bottom region for each
// layer - we test that in case of fill_density = 0 such narrow shells are
// discarded instead of grown
int bottom_solid_layers = 3;
auto config = Slic3r::DynamicPrintConfig::full_print_config_with({
{ "perimeters", 1 },
{ "fill_density", 0 },
// to prevent speeds from being altered
{ "cooling", "0" },
// to prevent speeds from being altered
{ "first_layer_speed", "100%" },
// prevent speed alteration
{ "enable_dynamic_overhang_speeds", 0 },
{ "layer_height", 0.4 },
{ "first_layer_height", 0.4 },
{ "extrusion_width", 0.55 },
{ "bottom_solid_layers", bottom_solid_layers },
{ "top_solid_layers", 0 },
{ "solid_infill_speed", 99 }
});
THEN("shells are not propagated across perimeters of the neighbor layer") {
std::string gcode = Slic3r::Test::slice({TestMesh::V}, config);
REQUIRE(layers_with_speed(gcode, 99).size() == bottom_solid_layers);
}
}
GIVEN("sloping_hole") {
int bottom_solid_layers = 3;
int top_solid_layers = 3;
int solid_speed = 99;
auto config = Slic3r::DynamicPrintConfig::full_print_config_with({
{ "perimeters", 3 },
// to prevent speeds from being altered
{ "cooling", "0" },
// to prevent speeds from being altered
{ "first_layer_speed", "100%" },
// prevent speed alteration
{ "enable_dynamic_overhang_speeds", 0 },
{ "layer_height", 0.4 },
{ "first_layer_height", 0.4 },
{ "bottom_solid_layers", bottom_solid_layers },
{ "top_solid_layers", top_solid_layers },
{ "solid_infill_speed", solid_speed },
{ "top_solid_infill_speed", solid_speed },
{ "bridge_speed", solid_speed },
{ "filament_diameter", 3. },
{ "nozzle_diameter", 0.5 }
});
THEN("no superfluous shells are generated") {
std::string gcode = Slic3r::Test::slice({TestMesh::sloping_hole}, config);
REQUIRE(layers_with_speed(gcode, solid_speed).size() == bottom_solid_layers + top_solid_layers);
}
}

//TODO CHECK AFTER REMOVAL OF "ensure_vertical_wall_thickness"
// GIVEN("V shape") {
// // we need to check against one perimeter because this test is calibrated
// // (shape, extrusion_width) so that perimeters cover the bottom surfaces of
// // their lower layer - the test checks that shells are not generated on the
// // above layers (thus 'across' the shadow perimeter)
// // the test is actually calibrated to leave a narrow bottom region for each
// // layer - we test that in case of fill_density = 0 such narrow shells are
// // discarded instead of grown
// int bottom_solid_layers = 3;
// auto config = Slic3r::DynamicPrintConfig::full_print_config_with({
// { "perimeters", 1 },
// { "fill_density", 0 },
// // to prevent speeds from being altered
// { "cooling", "0" },
// // to prevent speeds from being altered
// { "first_layer_speed", "100%" },
// // prevent speed alteration
// { "enable_dynamic_overhang_speeds", 0 },
// { "layer_height", 0.4 },
// { "first_layer_height", 0.4 },
// { "extrusion_width", 0.55 },
// { "bottom_solid_layers", bottom_solid_layers },
// { "top_solid_layers", 0 },
// { "solid_infill_speed", 99 }
// });
// THEN("shells are not propagated across perimeters of the neighbor layer") {
// std::string gcode = Slic3r::Test::slice({TestMesh::V}, config);
// REQUIRE(layers_with_speed(gcode, 99).size() == bottom_solid_layers);
// }
// }
// GIVEN("sloping_hole") {
// int bottom_solid_layers = 3;
// int top_solid_layers = 3;
// int solid_speed = 99;
// auto config = Slic3r::DynamicPrintConfig::full_print_config_with({
// { "perimeters", 3 },
// // to prevent speeds from being altered
// { "cooling", "0" },
// // to prevent speeds from being altered
// { "first_layer_speed", "100%" },
// // prevent speed alteration
// { "enable_dynamic_overhang_speeds", 0 },
// { "layer_height", 0.4 },
// { "first_layer_height", 0.4 },
// { "bottom_solid_layers", bottom_solid_layers },
// { "top_solid_layers", top_solid_layers },
// { "solid_infill_speed", solid_speed },
// { "top_solid_infill_speed", solid_speed },
// { "bridge_speed", solid_speed },
// { "filament_diameter", 3. },
// { "nozzle_diameter", 0.5 }
// });
// THEN("no superfluous shells are generated") {
// std::string gcode = Slic3r::Test::slice({TestMesh::sloping_hole}, config);
// REQUIRE(layers_with_speed(gcode, solid_speed).size() == bottom_solid_layers + top_solid_layers);
// }
// }
GIVEN("20mm_cube, spiral vase") {
double layer_height = 0.3;
auto config = Slic3r::DynamicPrintConfig::full_print_config_with({
Expand Down

0 comments on commit de09af2

Please sign in to comment.