Fix NaN when adding negative part (#3423) (#3431)

This commit is contained in:
Noisyfox 2024-01-02 20:48:25 +08:00 committed by GitHub
parent 8e3f7e7bf2
commit 1ea33f0919
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2149,8 +2149,8 @@ void ObjectList::load_generic_subobject(const std::string& type_name, const Mode
// First (any) GLVolume of the selected instance. They all share the same instance matrix.
const GLVolume* v = selection.get_first_volume();
// Transform the new modifier to be aligned with the print bed.
new_volume->set_transformation(v->get_instance_transformation().get_matrix_no_offset().inverse());
const BoundingBoxf3 mesh_bb = new_volume->mesh().bounding_box();
new_volume->set_transformation(Geometry::Transformation::volume_to_bed_transformation(v->get_instance_transformation(), mesh_bb));
// Set the modifier position.
auto offset = (type_name == "Slab") ?
// Slab: Lift to print bed