Skip to content

Commit

Permalink
Actually make brim, and fix tests so that math is correct.
Browse files Browse the repository at this point in the history
  • Loading branch information
lordofhyphens committed Jul 28, 2018
1 parent c94a168 commit 60286bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
7 changes: 2 additions & 5 deletions src/test/libslic3r/test_print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,26 +75,23 @@ SCENARIO("Print: Brim generation") {
print->make_brim();
THEN("Brim Extrusion collection has 3 loops in it") {
REQUIRE(print->brim.items_count() == 3);
REQUIRE(print->brim.flatten().entities.size() == 3);
}
}
WHEN("Brim is set to 6mm") {
config->set("brim_width", 3);
config->set("brim_width", 6);
auto print {Slic3r::Test::init_print({m}, model, config)};
print->make_brim();
THEN("Brim Extrusion collection has 6 loops in it") {
REQUIRE(print->brim.items_count() == 6);
REQUIRE(print->brim.flatten().entities.size() == 6);
}
}
WHEN("Brim is set to 6mm, extrusion width 0.5mm") {
config->set("brim_width", 3);
config->set("brim_width", 6);
config->set("first_layer_extrusion_width", 0.5);
auto print {Slic3r::Test::init_print({m}, model, config)};
print->make_brim();
THEN("Brim Extrusion collection has 12 loops in it") {
REQUIRE(print->brim.items_count() == 12);
REQUIRE(print->brim.flatten().entities.size() == 12);
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion xs/src/libslic3r/Print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,18 @@ Print::process()
void
Print::make_brim()
{
if (this->state.is_done(psBrim)) return;
// prereqs
for(auto& obj: this->objects) {
obj->make_perimeters();
obj->infill();
obj->generate_support_material();
}

this->state.set_started(psBrim);
if (this->status_cb != nullptr)
this->status_cb(88, "Generating brim");
this->_make_brim();
this->state.set_done(psBrim);
}

void
Expand Down

0 comments on commit 60286bb

Please sign in to comment.