FIX: the position is incorrect when adding stl part
github: 980 Change-Id: I7274dc67ddeb646770281e7a13b322eab7d756bb
This commit is contained in:
parent
c81d8608dc
commit
1cfb6deb72
|
@ -2043,10 +2043,6 @@ void ObjectList::load_modifier(const wxArrayString& input_files, ModelObject& mo
|
||||||
ModelVolume* new_volume = model_object.add_volume(std::move(mesh), type);
|
ModelVolume* new_volume = model_object.add_volume(std::move(mesh), type);
|
||||||
new_volume->name = boost::filesystem::path(input_file).filename().string();
|
new_volume->name = boost::filesystem::path(input_file).filename().string();
|
||||||
|
|
||||||
// BBS: object_mesh.get_init_shift() keep the relative position
|
|
||||||
TriangleMesh object_mesh = model_object.volumes[0]->mesh();
|
|
||||||
new_volume->set_offset(new_volume->mesh().get_init_shift() - object_mesh.get_init_shift());
|
|
||||||
|
|
||||||
// set a default extruder value, since user can't add it manually
|
// set a default extruder value, since user can't add it manually
|
||||||
// BBS
|
// BBS
|
||||||
int extruder_id = 0;
|
int extruder_id = 0;
|
||||||
|
@ -2069,6 +2065,8 @@ void ObjectList::load_modifier(const wxArrayString& input_files, ModelObject& mo
|
||||||
const Vec3d offset = Vec3d(instance_bb.max.x(), instance_bb.min.y(), instance_bb.min.z()) + 0.5 * mesh_bb.size() - instance_offset;
|
const Vec3d offset = Vec3d(instance_bb.max.x(), instance_bb.min.y(), instance_bb.min.z()) + 0.5 * mesh_bb.size() - instance_offset;
|
||||||
new_volume->set_offset(inv_inst_transform * offset);
|
new_volume->set_offset(inv_inst_transform * offset);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
new_volume->set_offset(new_volume->source.mesh_offset - model_object.volumes.front()->source.mesh_offset);
|
||||||
|
|
||||||
added_volumes.push_back(new_volume);
|
added_volumes.push_back(new_volume);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue