mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-07-14 11:41:49 +08:00
use first_layer_size_compasation for the lslices, so the brims are printed against the real lines.
This commit is contained in:
parent
011f9fbe5f
commit
94a4772549
@ -2435,13 +2435,14 @@ end:
|
||||
// Merge all regions' slices to get islands, chain them by a shortest path.
|
||||
layer->make_slices();
|
||||
//FIXME: can't make it work in multi-region object, it seems useful to avoid bridge on top of first layer compensation
|
||||
if (layer->regions().size() == 1 && layer_id == 0 && first_layer_compensation < 0 && m_config.raft_layers == 0) {
|
||||
// The Elephant foot has been compensated, therefore the 1st layer's lslices are shrank with the Elephant foot compensation value.
|
||||
// Store the uncompensated value there.
|
||||
assert(! m_layers.empty());
|
||||
assert(m_layers.front()->id() == 0);
|
||||
m_layers.front()->lslices = offset_ex(std::move(m_layers.front()->lslices), -first_layer_compensation);
|
||||
}
|
||||
//so it's disable, if you want an offset, use the offset field.
|
||||
//if (layer->regions().size() == 1 && layer_id == 0 && first_layer_compensation < 0 && m_config.raft_layers == 0) {
|
||||
// // The Elephant foot has been compensated, therefore the 1st layer's lslices are shrank with the Elephant foot compensation value.
|
||||
// // Store the uncompensated value there.
|
||||
// assert(! m_layers.empty());
|
||||
// assert(m_layers.front()->id() == 0);
|
||||
// m_layers.front()->lslices = offset_ex(std::move(m_layers.front()->lslices), -first_layer_compensation);
|
||||
//}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -144,7 +144,7 @@ SCENARIO("Print: Brim generation") {
|
||||
REQUIRE(print.brim().items_count() == 3);
|
||||
}
|
||||
}
|
||||
WHEN("Brim is set to 6mm") {
|
||||
WHEN("Brim is set to 6mm") {
|
||||
config.set_key_value("brim_width", new ConfigOptionFloat(6));
|
||||
Print print{};
|
||||
Slic3r::Test::init_print(print, { m }, model, &config);
|
||||
@ -153,6 +153,39 @@ SCENARIO("Print: Brim generation") {
|
||||
REQUIRE(print.brim().items_count() == 6);
|
||||
}
|
||||
}
|
||||
WHEN("Brim is set to 6mm with 1mm offset") {
|
||||
config.set_key_value("brim_width", new ConfigOptionFloat(6));
|
||||
config.set_key_value("brim_offset", new ConfigOptionFloat(1));
|
||||
Print print{};
|
||||
Slic3r::Test::init_print(print, { m }, model, &config);
|
||||
print.process();
|
||||
THEN("Brim Extrusion collection has 5 loops in it") {
|
||||
REQUIRE(print.brim().items_count() == 5);
|
||||
}
|
||||
}
|
||||
WHEN("Brim without first layer compensation") {
|
||||
config.set_key_value("brim_width", new ConfigOptionFloat(2));
|
||||
config.set_key_value("brim_offset", new ConfigOptionFloat(0));
|
||||
Print print{};
|
||||
Slic3r::Test::init_print(print, { m }, model, &config);
|
||||
print.process();
|
||||
THEN("First Brim Extrusion has a length of ~88") {
|
||||
REQUIRE(unscaled(print.brim().entities.front()->length()) > 22*4);
|
||||
REQUIRE(unscaled(print.brim().entities.front()->length()) < 22*4+1);
|
||||
}
|
||||
}
|
||||
WHEN("Brim with 1mm first layer compensation") {
|
||||
config.set_key_value("brim_width", new ConfigOptionFloat(2));
|
||||
config.set_key_value("brim_offset", new ConfigOptionFloat(0));
|
||||
config.set_key_value("first_layer_size_compensation", new ConfigOptionFloat(-1));
|
||||
Print print{};
|
||||
Slic3r::Test::init_print(print, { m }, model, &config);
|
||||
print.process();
|
||||
THEN("First Brim Extrusion has a length of ~80") {
|
||||
REQUIRE(unscaled(print.brim().entities.front()->length()) > 20 * 4);
|
||||
REQUIRE(unscaled(print.brim().entities.front()->length()) < 20 * 4 + 1);
|
||||
}
|
||||
}
|
||||
WHEN("Brim is set to 6mm, extrusion width 0.5mm") {
|
||||
config.set_key_value("brim_width", new ConfigOptionFloat(6));
|
||||
config.set_key_value("first_layer_extrusion_width", new ConfigOptionFloatOrPercent(0.5, false));
|
||||
|
Loading…
x
Reference in New Issue
Block a user