ENH: refine the logic of extruder_clearance_radius

1. use extruder_clearance_max_radius instead
2. set the value of P1P/P1S to the same value of X1C
JIRA: STUDIO-4214

Change-Id: I1ae5e4203db0933854b4388b5505dbf34b40edae
(cherry picked from commit 19cb6a0fbad0192d39813e449baed090baa163c5)
This commit is contained in:
lane.wei 2023-08-24 22:05:19 +08:00 committed by Lane.Wei
parent 5957912eaa
commit 6d5fad236e
5 changed files with 8 additions and 10 deletions

View file

@ -529,7 +529,7 @@ StringObjectException Print::sequential_print_clearance_valid(const Print &print
auto tmp = 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_max_radius.value - EPSILON)),
float(scale_(0.5 * print.config().extruder_clearance_max_radius.value - 0.01)),
jtRound, scale_(0.1));
if (!tmp.empty()) { // tmp may be empty due to clipper's bug, see STUDIO-2452
convex_hull = tmp.front();
@ -736,7 +736,7 @@ StringObjectException Print::sequential_print_clearance_valid(const Print &print
{
auto inst = print_instance_with_bounding_box[k].print_instance;
// 只需要考虑喷嘴到滑杆的偏移量,这个比整个工具头的碰撞半径要小得多
auto bbox = print_instance_with_bounding_box[k].bounding_box.inflated(-scale_(0.5 * print.config().extruder_clearance_radius.value));
auto bbox = print_instance_with_bounding_box[k].bounding_box.inflated(-scale_(0.5 * print.config().extruder_clearance_max_radius.value));
auto iy1 = bbox.min.y();
auto iy2 = bbox.max.y();
(const_cast<ModelInstance*>(inst->model_instance))->arrange_order = k+1;