ENH: improve auto arranging and by-object printing

1. In auto arranging bed temp can be higher than vitrify temp by no more than 15 degrees.
2. In by-object printing we use max radius for clearance
3. Add P1P max radius

Change-Id: If595f3e19fd74f6f36d2f394edbb835c413cc800
(cherry picked from commit 2af42420ad3770f0728adb583082600544519a58)
This commit is contained in:
Arthur 2022-12-20 18:32:13 +08:00 committed by Lane.Wei
parent 400ce3bcfd
commit 7596b3fed9
4 changed files with 6 additions and 4 deletions

File diff suppressed because one or more lines are too long

View file

@ -78,6 +78,7 @@ using ItemGroup = std::vector<std::reference_wrapper<Item>>;
// A coefficient used in separating bigger items and smaller items.
const double BIG_ITEM_TRESHOLD = 0.02;
#define VITRIFY_TEMP_DIFF_THRSH 15 // bed temp can be higher than vitrify temp, but not higher than this thresh
// Fill in the placer algorithm configuration with values carefully chosen for
// Slic3r.
@ -423,9 +424,9 @@ protected:
for (int i = 0; i < m_items.size(); i++) {
Item& p = m_items[i];
if (p.is_virt_object) continue;
score += lambda3 * (item.bed_temp - p.vitrify_temp > 0);
score += lambda3 * (item.bed_temp - p.vitrify_temp > VITRIFY_TEMP_DIFF_THRSH);
}
score += lambda3 * (item.bed_temp - item.vitrify_temp > 0);
score += lambda3 * (item.bed_temp - item.vitrify_temp > VITRIFY_TEMP_DIFF_THRSH);
score += lambda4 * hasRowHeightConflict + lambda4 * hasLidHeightConflict;
}
else {

View file

@ -448,7 +448,7 @@ StringObjectException Print::sequential_print_clearance_valid(const Print &print
convex_hull = offset(convex_hull_no_offset,
// Shrink the extruder_clearance_radius a tiny bit, so that if the object arrangement algorithm placed the objects
// exactly by satisfying the extruder_clearance_radius, this test will not trigger collision.
float(scale_(0.5 * print.config().extruder_clearance_radius.value - EPSILON)),
float(scale_(0.5 * print.config().extruder_clearance_max_radius.value - EPSILON)),
jtRound, scale_(0.1)).front();
// instance.shift is a position of a centered object, while model object may not be centered.
// Convert the shift from the PrintObject's coordinates into ModelObject's coordinates by removing the centering offset.

View file

@ -388,7 +388,7 @@ void ArrangeJob::prepare()
params.clearance_height_to_rod = print.config().extruder_clearance_height_to_rod.value;
params.clearance_height_to_lid = print.config().extruder_clearance_height_to_lid.value;
params.cleareance_radius = print.config().extruder_clearance_radius.value;
params.cleareance_radius = print.config().extruder_clearance_max_radius.value;
params.printable_height = print.config().printable_height.value;
params.allow_rotations = settings.enable_rotation;
params.allow_multi_materials_on_same_plate = settings.allow_multi_materials_on_same_plate;