Enabling object skirt. (#6487)

Implements individual object skirts, as requested in  **Individual skirts when printing by object. #3486** and  **Skirt around each object when using "by object" sequence #2652**

Now skirt type could be
![image](https://github.com/user-attachments/assets/532ecd91-fe3e-4bdb-b22f-ef28439ab7a6)

This PR based on several refactorings, including  **Configure skirt start point #6490** PR. To make review more easy each step was committed individually. Obviously them could be separated to different PRs or dropped.

I removed `prime_extruder && first_layer && extruder_id == first_extruder_id` as explicit object skirt is available.

Open question : do we need both common and object skirt together, probably with separate loop number?


All four combinations are possible.

Print by layer, common skirt:
![image](https://github.com/user-attachments/assets/5509f10b-ed3b-4243-8763-7ddcb101c67a)

Print by layer, object skirt:
![image](https://github.com/user-attachments/assets/deca3ca6-8bf7-4e5b-a356-2f5dd6e81566)

Print by object , object skirt:
![image](https://github.com/user-attachments/assets/7d1b2ddc-e61f-4d77-9ed4-e33fdd62d290)

Print by object , common skirt (any meaning?):
![image](https://github.com/user-attachments/assets/e7883eb4-b1a3-4158-a7f4-ce0658bc1939)
This commit is contained in:
SoftFever 2024-09-07 23:46:54 +08:00 committed by GitHub
commit 415bedef94
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 342 additions and 381 deletions

View file

@ -5227,13 +5227,12 @@ void GLCanvas3D::update_sequential_clearance()
// the results are then cached for following displacements
if (m_sequential_print_clearance_first_displacement) {
m_sequential_print_clearance.m_hull_2d_cache.clear();
bool all_objects_are_short = std::all_of(fff_print()->objects().begin(), fff_print()->objects().end(), \
[&](PrintObject* obj) { return obj->height() < scale_(fff_print()->config().nozzle_height.value - MARGIN_HEIGHT); });
auto [object_skirt_offset, _] = fff_print()->object_skirt_offset();
float shrink_factor;
if (all_objects_are_short)
shrink_factor = scale_(0.5 * MAX_OUTER_NOZZLE_DIAMETER - 0.1);
if (fff_print()->is_all_objects_are_short())
shrink_factor = scale_(std::max(0.5f * MAX_OUTER_NOZZLE_DIAMETER, object_skirt_offset) - 0.1);
else
shrink_factor = static_cast<float>(scale_(0.5 * fff_print()->config().extruder_clearance_radius.value - EPSILON));
shrink_factor = static_cast<float>(scale_(0.5 * fff_print()->config().extruder_clearance_radius.value + object_skirt_offset - 0.1));
double mitter_limit = scale_(0.1);
m_sequential_print_clearance.m_hull_2d_cache.reserve(m_model->objects.size());