mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 12:55:53 +08:00
Add explicit minimum bed distance (10mm) for XL printers when arranging
This commit is contained in:
parent
0726b0b5c6
commit
16793273a1
@ -687,7 +687,9 @@ void arrange(ArrangePolygons &items,
|
|||||||
const SegmentedRectangleBed &bed,
|
const SegmentedRectangleBed &bed,
|
||||||
const ArrangeParams ¶ms)
|
const ArrangeParams ¶ms)
|
||||||
{
|
{
|
||||||
arrange(items, excludes, bed.bb, params);
|
auto arrbed = bed.bb;
|
||||||
|
arrbed.offset(-bed.inset);
|
||||||
|
arrange(items, excludes, arrbed, params);
|
||||||
|
|
||||||
if (! excludes.empty())
|
if (! excludes.empty())
|
||||||
return;
|
return;
|
||||||
@ -744,6 +746,19 @@ void arrange(ArrangePolygons &items,
|
|||||||
|
|
||||||
Vec2crd d = bb.center() - pilebb[bedidx].center();
|
Vec2crd d = bb.center() - pilebb[bedidx].center();
|
||||||
|
|
||||||
|
auto bedbb = bed.bb;
|
||||||
|
bedbb.offset(-bed.inset);
|
||||||
|
auto pilebbx = pilebb[bedidx];
|
||||||
|
pilebbx.translate(d);
|
||||||
|
|
||||||
|
Point corr{0, 0};
|
||||||
|
corr.x() = -std::min(0, pilebbx.min.x() - bedbb.min.x())
|
||||||
|
-std::max(0, pilebbx.max.x() - bedbb.max.x());
|
||||||
|
corr.y() = -std::min(0, pilebbx.min.y() - bedbb.min.y())
|
||||||
|
-std::max(0, pilebbx.max.y() - bedbb.max.y());
|
||||||
|
|
||||||
|
d += corr;
|
||||||
|
|
||||||
for (auto &itm : items)
|
for (auto &itm : items)
|
||||||
if (itm.bed_idx == bedidx)
|
if (itm.bed_idx == bedidx)
|
||||||
itm.translation += d;
|
itm.translation += d;
|
||||||
|
@ -38,6 +38,7 @@ public:
|
|||||||
struct SegmentedRectangleBed {
|
struct SegmentedRectangleBed {
|
||||||
Vec<2, size_t> segments;
|
Vec<2, size_t> segments;
|
||||||
BoundingBox bb;
|
BoundingBox bb;
|
||||||
|
coord_t inset = 0;
|
||||||
|
|
||||||
SegmentedRectangleBed (const BoundingBox &bb,
|
SegmentedRectangleBed (const BoundingBox &bb,
|
||||||
size_t segments_x,
|
size_t segments_x,
|
||||||
|
@ -4663,7 +4663,9 @@ Points get_bed_shape(const DynamicPrintConfig &config)
|
|||||||
void get_bed_shape(const DynamicPrintConfig &cfg, arrangement::ArrangeBed &out)
|
void get_bed_shape(const DynamicPrintConfig &cfg, arrangement::ArrangeBed &out)
|
||||||
{
|
{
|
||||||
if (is_XL_printer(cfg)) {
|
if (is_XL_printer(cfg)) {
|
||||||
out = arrangement::SegmentedRectangleBed{get_extents(get_bed_shape(cfg)), 4, 4};
|
arrangement::SegmentedRectangleBed bed{get_extents(get_bed_shape(cfg)), 4, 4};
|
||||||
|
bed.inset = scaled(10.);
|
||||||
|
out = bed;
|
||||||
} else {
|
} else {
|
||||||
out = arrangement::to_arrange_bed(get_bed_shape(cfg));
|
out = arrangement::to_arrange_bed(get_bed_shape(cfg));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user