Merge some BS1.7 changes:

Boolean operation feature
This commit is contained in:
SoftFever 2023-08-08 22:13:52 +08:00
parent 9e73dfeb5d
commit da05ae02da
73 changed files with 2496 additions and 481 deletions

View file

@ -1961,7 +1961,9 @@ void Selection::update_type()
unsigned int sels_cntr = 0;
for (ObjectIdxsToInstanceIdxsMap::iterator it = m_cache.content.begin(); it != m_cache.content.end(); ++it)
{
const ModelObject* model_object = m_model->objects[it->first];
bool is_wipe_tower = it->first >= 1000;
int actual_obj_id = is_wipe_tower ? it->first - 1000 : it->first;
const ModelObject *model_object = m_model->objects[actual_obj_id];
unsigned int volumes_count = (unsigned int)model_object->volumes.size();
unsigned int instances_count = (unsigned int)model_object->instances.size();
sels_cntr += volumes_count * instances_count;
@ -2710,9 +2712,14 @@ void Selection::paste_objects_from_clipboard()
displacement = {empty_cell.x() + point_offset.x(), empty_cell.y() + point_offset.y(), start_offset(2)};
}
for (ModelInstance* inst : dst_object->instances)
for (ModelInstance* inst : dst_object->instances) {
inst->set_offset(displacement);
//BBS init asssmble transformation
Geometry::Transformation t = inst->get_transformation();
inst->set_assemble_transformation(t);
}
object_idxs.push_back(m_model->objects.size() - 1);
#ifdef _DEBUG
check_model_ids_validity(*m_model);