Auto arrange: Do at least something if the objects do not fit the bed.
Thans @alexr https://github.com/prusa3d/Slic3r/issues/336
This commit is contained in:
parent
5cae4cc614
commit
a4992602ee
1 changed files with 14 additions and 1 deletions
|
@ -167,13 +167,26 @@ TriangleMesh Model::mesh() const
|
||||||
static bool _arrange(const Pointfs &sizes, coordf_t dist, const BoundingBoxf* bb, Pointfs &out)
|
static bool _arrange(const Pointfs &sizes, coordf_t dist, const BoundingBoxf* bb, Pointfs &out)
|
||||||
{
|
{
|
||||||
// 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 != nullptr) {
|
||||||
|
// 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
|
||||||
|
nullptr, // 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…
Add table
Reference in a new issue