mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-12 23:29:01 +08:00
Test layer heights above the old 10mm layer height limit and that the layer height is still restricted by nozzle diameter.
This commit is contained in:
parent
64b0d7c709
commit
daaceff20a
@ -7,15 +7,16 @@ using namespace Slic3r::Test;
|
||||
using namespace std::literals;
|
||||
|
||||
SCENARIO("PrintObject: object layer heights") {
|
||||
GIVEN("20mm cube and config that has a 3mm nozzle and a 2mm requested layer height") {
|
||||
GIVEN("20mm cube and default initial config, initial layer height of 2mm") {
|
||||
auto config {Slic3r::Config::new_from_defaults()};
|
||||
TestMesh m { TestMesh::cube_20x20x20 };
|
||||
Slic3r::Model model;
|
||||
config->set("nozzle_diameter", "3");
|
||||
config->set("layer_height", 2.0);
|
||||
|
||||
config->set("first_layer_height", 2.0);
|
||||
|
||||
WHEN("generate_object_layers() is called with a starting layer of 2mm") {
|
||||
WHEN("generate_object_layers() is called for 2mm layer heights and nozzle diameter of 3mm") {
|
||||
config->set("nozzle_diameter", "3");
|
||||
config->set("layer_height", 2.0);
|
||||
auto print {Slic3r::Test::init_print({m}, model, config)};
|
||||
auto result {print->objects[0]->generate_object_layers(2.0)};
|
||||
THEN("The output vector has 10 entries") {
|
||||
@ -29,5 +30,50 @@ SCENARIO("PrintObject: object layer heights") {
|
||||
}
|
||||
}
|
||||
}
|
||||
WHEN("generate_object_layers() is called for 10mm layer heights and nozzle diameter of 11mm") {
|
||||
config->set("nozzle_diameter", "11");
|
||||
config->set("layer_height", 10.0);
|
||||
auto print {Slic3r::Test::init_print({m}, model, config)};
|
||||
auto result {print->objects[0]->generate_object_layers(2.0)};
|
||||
THEN("The output vector has 2 entries") {
|
||||
REQUIRE(result.size() == 3);
|
||||
}
|
||||
AND_THEN("Layer 0 is at 2mm") {
|
||||
REQUIRE(result[0] == Approx(2.0));
|
||||
}
|
||||
AND_THEN("Layer 1 is at 12mm") {
|
||||
REQUIRE(result[1] == Approx(12.0));
|
||||
}
|
||||
}
|
||||
WHEN("generate_object_layers() is called for 15mm layer heights and nozzle diameter of 16mm") {
|
||||
config->set("nozzle_diameter", "16");
|
||||
config->set("layer_height", 15.0);
|
||||
auto print {Slic3r::Test::init_print({m}, model, config)};
|
||||
auto result {print->objects[0]->generate_object_layers(2.0)};
|
||||
THEN("The output vector has 2 entries") {
|
||||
REQUIRE(result.size() == 3);
|
||||
}
|
||||
AND_THEN("Layer 0 is at 2mm") {
|
||||
REQUIRE(result[0] == Approx(2.0));
|
||||
}
|
||||
AND_THEN("Layer 1 is at 17mm") {
|
||||
REQUIRE(result[1] == Approx(17.0));
|
||||
}
|
||||
}
|
||||
WHEN("generate_object_layers() is called for 15mm layer heights and nozzle diameter of 5mm") {
|
||||
config->set("nozzle_diameter", "5");
|
||||
config->set("layer_height", 15.0);
|
||||
auto print {Slic3r::Test::init_print({m}, model, config)};
|
||||
auto result {print->objects[0]->generate_object_layers(2.0)};
|
||||
THEN("The layer height is limited to 5mm.") {
|
||||
CHECK(result.size() == 5);
|
||||
coordf_t last = 2.0;
|
||||
for (size_t i = 1; i < result.size(); i++) {
|
||||
REQUIRE((result[i] - last) == Approx(5.0));
|
||||
last = result[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user