Bugfix: skirt and brim were not recalculated when objects where just moved in plater
This commit is contained in:
parent
a5787cfb04
commit
334086d605
7 changed files with 37 additions and 27 deletions
|
@ -351,15 +351,6 @@ Print::add_model_object(ModelObject* model_object, int idx)
|
|||
? this->set_new_object(idx, model_object, bb)
|
||||
: this->add_object(model_object, bb);
|
||||
}
|
||||
|
||||
{
|
||||
Points copies;
|
||||
for (ModelInstancePtrs::const_iterator i = model_object->instances.begin(); i != model_object->instances.end(); ++i) {
|
||||
copies.push_back(Point::new_scale((*i)->offset.x, (*i)->offset.y));
|
||||
}
|
||||
o->set_copies(copies);
|
||||
}
|
||||
o->layer_height_ranges = model_object->layer_height_ranges;
|
||||
|
||||
for (ModelVolumePtrs::const_iterator v_i = model_object->volumes.begin(); v_i != model_object->volumes.end(); ++v_i) {
|
||||
size_t volume_id = v_i - model_object->volumes.begin();
|
||||
|
|
|
@ -103,7 +103,8 @@ class PrintObject
|
|||
ModelObject* model_object();
|
||||
|
||||
Points copies() const;
|
||||
void set_copies(const Points &points);
|
||||
bool set_copies(const Points &points);
|
||||
bool reload_model_instances();
|
||||
|
||||
// adds region_id, too, if necessary
|
||||
void add_region_volume(int region_id, int volume_id);
|
||||
|
|
|
@ -26,6 +26,9 @@ PrintObject::PrintObject(Print* print, ModelObject* model_object, const Bounding
|
|||
Pointf3 size = modobj_bbox.size();
|
||||
this->size = Point3(scale_(size.x), scale_(size.y), scale_(size.z));
|
||||
}
|
||||
|
||||
this->reload_model_instances();
|
||||
this->layer_height_ranges = model_object->layer_height_ranges;
|
||||
}
|
||||
|
||||
PrintObject::~PrintObject()
|
||||
|
@ -50,7 +53,7 @@ PrintObject::copies() const
|
|||
return this->_copies;
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
PrintObject::set_copies(const Points &points)
|
||||
{
|
||||
this->_copies = points;
|
||||
|
@ -69,8 +72,20 @@ PrintObject::set_copies(const Points &points)
|
|||
this->_shifted_copies.push_back(copy);
|
||||
}
|
||||
|
||||
this->_print->invalidate_step(psSkirt);
|
||||
this->_print->invalidate_step(psBrim);
|
||||
bool invalidated = false;
|
||||
if (this->_print->invalidate_step(psSkirt)) invalidated = true;
|
||||
if (this->_print->invalidate_step(psBrim)) invalidated = true;
|
||||
return invalidated;
|
||||
}
|
||||
|
||||
bool
|
||||
PrintObject::reload_model_instances()
|
||||
{
|
||||
Points copies;
|
||||
for (ModelInstancePtrs::const_iterator i = this->_model_object->instances.begin(); i != this->_model_object->instances.end(); ++i) {
|
||||
copies.push_back(Point::new_scale((*i)->offset.x, (*i)->offset.y));
|
||||
}
|
||||
return this->set_copies(copies);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue