mirror of
https://github.com/QIDITECH/QIDISlicer.git
synced 2026-02-03 09:28:44 +03:00
fix some bug
This commit is contained in:
@@ -1544,21 +1544,22 @@ bool GLCanvas3D::check_volumes_outside_state(GLVolumeCollection& volumes, ModelI
|
||||
state = BuildVolume::ObjectState::Below;
|
||||
else {
|
||||
switch (build_volume.type()) {
|
||||
// B66
|
||||
case BuildVolume::Type::Rectangle:
|
||||
//FIXME this test does not evaluate collision of a build volume bounding box with non-convex objects.
|
||||
state = build_volume.volume_state_bbox(volume_bbox(*volume), true, &bed_idx);
|
||||
// B66 //y21
|
||||
if (state == BuildVolume::ObjectState::Inside) {
|
||||
for (size_t i = 0; i < m_model->objects.size(); ++i) {
|
||||
ModelObject * object = m_model->objects[i];
|
||||
ModelInstance *instance = object->instances[0];
|
||||
Polygon hull = instance->convex_hull_2d();
|
||||
|
||||
state = build_volume.check_outside(hull);
|
||||
if (state != BuildVolume::ObjectState::Inside) {
|
||||
break;
|
||||
}
|
||||
int obj_idx = volume->object_idx();
|
||||
ModelObjectPtrs model_parts = wxGetApp().model().objects;
|
||||
ModelObject* model_obj = model_parts[obj_idx];
|
||||
ModelInstance* instance = model_obj->instances[0];
|
||||
Polygon hull = instance->convex_hull_2d();
|
||||
state = build_volume.check_outside(hull);
|
||||
if (state != BuildVolume::ObjectState::Inside) {
|
||||
model_obj->in_exclude = true;
|
||||
}
|
||||
else
|
||||
model_obj->in_exclude = false;
|
||||
}
|
||||
break;
|
||||
case BuildVolume::Type::Circle:
|
||||
|
||||
@@ -1895,11 +1895,12 @@ void Plater::priv::object_list_changed()
|
||||
for (const ModelObject *object : wxGetApp().model().objects) {
|
||||
for (const ModelInstance *instance : object->instances) {
|
||||
const auto it{s_multiple_beds.get_inst_map().find(instance->id())};
|
||||
//y21
|
||||
if (
|
||||
it != s_multiple_beds.get_inst_map().end()
|
||||
(it != s_multiple_beds.get_inst_map().end()
|
||||
&& it->second == bed_index
|
||||
&& instance->printable
|
||||
&& instance->print_volume_state == ModelInstancePVS_Partly_Outside
|
||||
&& instance->print_volume_state == ModelInstancePVS_Partly_Outside) || (object->in_exclude)
|
||||
) {
|
||||
s_print_statuses[bed_index] = PrintStatus::outside;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user