mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-04 05:10:42 +08:00
Only use the supplied bounding box (bed shape) as a hint when auto arranging, and revert to unconstrained arrangement on failure (still better than no arranging at all). #2725
This commit is contained in:
parent
5dfafda779
commit
a49d82691e
@ -255,13 +255,26 @@ bool
|
|||||||
Model::_arrange(const Pointfs &sizes, coordf_t dist, const BoundingBoxf* bb, Pointfs &out) const
|
Model::_arrange(const Pointfs &sizes, coordf_t dist, const BoundingBoxf* bb, Pointfs &out) const
|
||||||
{
|
{
|
||||||
// we supply unscaled data to arrange()
|
// we supply unscaled data to arrange()
|
||||||
return Slic3r::Geometry::arrange(
|
bool result = Slic3r::Geometry::arrange(
|
||||||
sizes.size(), // number of parts
|
sizes.size(), // number of parts
|
||||||
BoundingBoxf(sizes).max, // width and height of a single cell
|
BoundingBoxf(sizes).max, // width and height of a single cell
|
||||||
dist, // distance between cells
|
dist, // distance between cells
|
||||||
bb, // bounding box of the area to fill
|
bb, // bounding box of the area to fill
|
||||||
out // output positions
|
out // output positions
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (!result && bb != NULL) {
|
||||||
|
// Try to arrange again ignoring bb
|
||||||
|
result = Slic3r::Geometry::arrange(
|
||||||
|
sizes.size(), // number of parts
|
||||||
|
BoundingBoxf(sizes).max, // width and height of a single cell
|
||||||
|
dist, // distance between cells
|
||||||
|
NULL, // bounding box of the area to fill
|
||||||
|
out // output positions
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* arrange objects preserving their instance count
|
/* arrange objects preserving their instance count
|
||||||
|
Loading…
x
Reference in New Issue
Block a user