Bugfix: validation for sequential printing was not entirely correct. #2480
This commit is contained in:
parent
9b9ed91e6e
commit
af92e3d49e
1 changed files with 16 additions and 15 deletions
|
@ -561,7 +561,11 @@ Print::validate() const
|
||||||
FOREACH_OBJECT(this, i_object) {
|
FOREACH_OBJECT(this, i_object) {
|
||||||
PrintObject* object = *i_object;
|
PrintObject* object = *i_object;
|
||||||
|
|
||||||
// get convex hulls of all meshes assigned to this print object
|
/* get convex hull of all meshes assigned to this print object
|
||||||
|
(this is the same as model_object()->raw_mesh.convex_hull()
|
||||||
|
but probably more efficient */
|
||||||
|
Polygon convex_hull;
|
||||||
|
{
|
||||||
Polygons mesh_convex_hulls;
|
Polygons mesh_convex_hulls;
|
||||||
for (size_t i = 0; i < this->regions.size(); ++i) {
|
for (size_t i = 0; i < this->regions.size(); ++i) {
|
||||||
for (std::vector<int>::const_iterator it = object->region_volumes[i].begin(); it != object->region_volumes[i].end(); ++it) {
|
for (std::vector<int>::const_iterator it = object->region_volumes[i].begin(); it != object->region_volumes[i].end(); ++it) {
|
||||||
|
@ -572,15 +576,12 @@ Print::validate() const
|
||||||
}
|
}
|
||||||
|
|
||||||
// make a single convex hull for all of them
|
// make a single convex hull for all of them
|
||||||
Polygon convex_hull;
|
|
||||||
Slic3r::Geometry::convex_hull(mesh_convex_hulls, &convex_hull);
|
Slic3r::Geometry::convex_hull(mesh_convex_hulls, &convex_hull);
|
||||||
|
}
|
||||||
|
|
||||||
// apply the same transformations we apply to the actual meshes when slicing them
|
// apply the same transformations we apply to the actual meshes when slicing them
|
||||||
object->model_object()->instances.front()->transform_polygon(&convex_hull);
|
object->model_object()->instances.front()->transform_polygon(&convex_hull);
|
||||||
|
|
||||||
// align object to Z = 0 and apply XY shift
|
|
||||||
convex_hull.translate(object->_copies_shift);
|
|
||||||
|
|
||||||
// grow convex hull with the clearance margin
|
// grow convex hull with the clearance margin
|
||||||
{
|
{
|
||||||
Polygons grown_hull;
|
Polygons grown_hull;
|
||||||
|
|
Loading…
Reference in a new issue