mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-14 23:15:52 +08:00
Stubbed out/implemented Print::process and generate_support_material.
(w/o unit tests)
This commit is contained in:
parent
321b5893b8
commit
eedf81e871
@ -97,6 +97,13 @@ Print::delete_object(size_t idx)
|
|||||||
void
|
void
|
||||||
Print::process()
|
Print::process()
|
||||||
{
|
{
|
||||||
|
if (this->status_cb != nullptr)
|
||||||
|
this->status_cb(70, "Infilling layers");
|
||||||
|
for(auto obj : this->objects) { obj->_infill(); }
|
||||||
|
for(auto obj : this->objects) { obj->generate_support_material(); }
|
||||||
|
|
||||||
|
this->make_skirt();
|
||||||
|
this->make_brim(); // must follow make_skirt
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -136,6 +136,10 @@ class PrintObject
|
|||||||
void delete_layer(int idx);
|
void delete_layer(int idx);
|
||||||
|
|
||||||
SupportMaterial* _support_material();
|
SupportMaterial* _support_material();
|
||||||
|
|
||||||
|
/// Initialize and generate support material.
|
||||||
|
void generate_support_material();
|
||||||
|
|
||||||
Flow _support_material_flow(FlowRole role = frSupportMaterial);
|
Flow _support_material_flow(FlowRole role = frSupportMaterial);
|
||||||
size_t support_layer_count() const;
|
size_t support_layer_count() const;
|
||||||
void clear_support_layers();
|
void clear_support_layers();
|
||||||
|
@ -1146,4 +1146,39 @@ PrintObject::_support_material_flow(FlowRole role)
|
|||||||
|
|
||||||
return support_flow;
|
return support_flow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
PrintObject::generate_support_material()
|
||||||
|
{
|
||||||
|
auto* print { this->_print };
|
||||||
|
auto& config {this->config };
|
||||||
|
//prereqs
|
||||||
|
this->_slice();
|
||||||
|
if (this->state.is_done(posSupportMaterial)) { return; }
|
||||||
|
|
||||||
|
this->state.set_started(posSupportMaterial);
|
||||||
|
|
||||||
|
this->clear_support_layers();
|
||||||
|
|
||||||
|
if ((!config.support_material
|
||||||
|
&& config.raft_layers == 0
|
||||||
|
&& config.support_material_enforce_layers == 0)
|
||||||
|
|| this->layers.size() < 2
|
||||||
|
) {
|
||||||
|
this->state.set_done(posSupportMaterial);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (print->status_cb != nullptr)
|
||||||
|
print->status_cb(85, "Generating support material");
|
||||||
|
|
||||||
|
this->_support_material()->generate(this);
|
||||||
|
|
||||||
|
this->state.set_done(posSupportMaterial);
|
||||||
|
|
||||||
|
std::stringstream stats {""};
|
||||||
|
|
||||||
|
if (print->status_cb != nullptr)
|
||||||
|
print->status_cb(85, stats.str().c_str());
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user