mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-10 08:17:51 -06:00
FIX: Assemble matrix error when adding text
Change-Id: I676a3534ccb725516457c0700368c7f57c9bb6d1
This commit is contained in:
parent
93ad247eff
commit
536ae58a4a
2 changed files with 13 additions and 10 deletions
|
@ -2193,7 +2193,7 @@ int ObjectList::load_mesh_part(const TriangleMesh &mesh, const wxString &name, c
|
||||||
Geometry::Transformation instance_transformation = mo->instances[0]->get_transformation();
|
Geometry::Transformation instance_transformation = mo->instances[0]->get_transformation();
|
||||||
|
|
||||||
// apply the instance transform to all volumes and reset instance transform except the offset
|
// apply the instance transform to all volumes and reset instance transform except the offset
|
||||||
apply_object_instance_transfrom_to_all_volumes(mo);
|
apply_object_instance_transfrom_to_all_volumes(mo, !is_temp);
|
||||||
|
|
||||||
ModelVolume *mv = mo->add_volume(mesh);
|
ModelVolume *mv = mo->add_volume(mesh);
|
||||||
mv->name = name.ToStdString();
|
mv->name = name.ToStdString();
|
||||||
|
@ -5210,10 +5210,12 @@ bool ObjectList::has_paint_on_segmentation()
|
||||||
return m_objects_model->HasInfoItem(InfoItemType::MmuSegmentation);
|
return m_objects_model->HasInfoItem(InfoItemType::MmuSegmentation);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectList::apply_object_instance_transfrom_to_all_volumes(ModelObject *model_object) {
|
void ObjectList::apply_object_instance_transfrom_to_all_volumes(ModelObject *model_object, bool need_update_assemble_matrix)
|
||||||
|
{
|
||||||
const Geometry::Transformation &instance_transformation = model_object->instances[0]->get_transformation();
|
const Geometry::Transformation &instance_transformation = model_object->instances[0]->get_transformation();
|
||||||
Vec3d original_instance_center = instance_transformation.get_offset();
|
Vec3d original_instance_center = instance_transformation.get_offset();
|
||||||
|
|
||||||
|
if (need_update_assemble_matrix) {
|
||||||
// apply the instance_transform(except offset) to assemble_transform
|
// apply the instance_transform(except offset) to assemble_transform
|
||||||
Geometry::Transformation instance_transformation_copy = instance_transformation;
|
Geometry::Transformation instance_transformation_copy = instance_transformation;
|
||||||
instance_transformation_copy.set_offset(Vec3d(0, 0, 0)); // remove the effect of offset
|
instance_transformation_copy.set_offset(Vec3d(0, 0, 0)); // remove the effect of offset
|
||||||
|
@ -5221,6 +5223,7 @@ void ObjectList::apply_object_instance_transfrom_to_all_volumes(ModelObject *mod
|
||||||
const Transform3d &assemble_matrix = model_object->instances[0]->get_assemble_transformation().get_matrix();
|
const Transform3d &assemble_matrix = model_object->instances[0]->get_assemble_transformation().get_matrix();
|
||||||
Transform3d new_assemble_transform = assemble_matrix * instance_inverse_matrix;
|
Transform3d new_assemble_transform = assemble_matrix * instance_inverse_matrix;
|
||||||
model_object->instances[0]->set_assemble_from_transform(new_assemble_transform);
|
model_object->instances[0]->set_assemble_from_transform(new_assemble_transform);
|
||||||
|
}
|
||||||
|
|
||||||
// apply the instance_transform to volumn
|
// apply the instance_transform to volumn
|
||||||
const Transform3d &transformation_matrix = instance_transformation.get_matrix();
|
const Transform3d &transformation_matrix = instance_transformation.get_matrix();
|
||||||
|
|
|
@ -455,7 +455,7 @@ private:
|
||||||
void OnEditingDone(wxDataViewEvent &event);
|
void OnEditingDone(wxDataViewEvent &event);
|
||||||
|
|
||||||
// apply the instance transform to all volumes and reset instance transform except the offset
|
// apply the instance transform to all volumes and reset instance transform except the offset
|
||||||
void apply_object_instance_transfrom_to_all_volumes(ModelObject *model_object);
|
void apply_object_instance_transfrom_to_all_volumes(ModelObject *model_object, bool need_update_assemble_matrix = true);
|
||||||
|
|
||||||
std::vector<int> m_columns_width;
|
std::vector<int> m_columns_width;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue