Merge branch 'master' into fs_emboss
# Conflicts: # src/libslic3r/Format/3mf.cpp # src/slic3r/GUI/Selection.cpp
This commit is contained in:
commit
ca848b0a14
11 changed files with 342 additions and 157 deletions
|
@ -846,6 +846,29 @@ namespace Slic3r {
|
|||
return false;
|
||||
}
|
||||
|
||||
// If instances contain a single volume, the volume offset should be 0,0,0
|
||||
// This equals to say that instance world position and volume world position should match
|
||||
// Correct all instances/volumes for which this does not hold
|
||||
for (int obj_id = 0; obj_id < int(model.objects.size()); ++obj_id) {
|
||||
ModelObject* o = model.objects[obj_id];
|
||||
if (o->volumes.size() == 1) {
|
||||
ModelVolume* v = o->volumes.front();
|
||||
const Slic3r::Geometry::Transformation& first_inst_trafo = o->instances.front()->get_transformation();
|
||||
const Vec3d world_vol_offset = (first_inst_trafo * v->get_transformation()).get_offset();
|
||||
const Vec3d world_inst_offset = first_inst_trafo.get_offset();
|
||||
|
||||
if (!world_vol_offset.isApprox(world_inst_offset)) {
|
||||
const Slic3r::Geometry::Transformation& vol_trafo = v->get_transformation();
|
||||
for (int inst_id = 0; inst_id < int(o->instances.size()); ++inst_id) {
|
||||
ModelInstance* i = o->instances[inst_id];
|
||||
const Slic3r::Geometry::Transformation& inst_trafo = i->get_transformation();
|
||||
i->set_offset((inst_trafo * vol_trafo).get_offset());
|
||||
}
|
||||
v->set_offset(Vec3d::Zero());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if ENABLE_RELOAD_FROM_DISK_REWORK
|
||||
for (int obj_id = 0; obj_id < int(model.objects.size()); ++obj_id) {
|
||||
ModelObject* o = model.objects[obj_id];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue