Fix few mirror related issues (#5827)
* Do not use get_scaling_factor then construct the matrix again, because it cannot properly handle situations that contains negative scale (mirror) / shear (SoftFever/OrcaSlicer#5578) * Do not use get_scaling_factor then construct the matrix again, because it cannot properly handle situations that contains negative scale (mirror) / shear (SoftFever/OrcaSlicer#5578, SoftFever/OrcaSlicer#4719)
This commit is contained in:
parent
7e85eb0d7d
commit
eeae1b2c7e
1 changed files with 5 additions and 9 deletions
|
@ -2480,11 +2480,7 @@ void ModelVolume::calculate_convex_hull_2d(const Geometry::Transformation &tran
|
|||
return;
|
||||
|
||||
Points pts;
|
||||
Vec3d rotation = transformation.get_rotation();
|
||||
Vec3d mirror = transformation.get_mirror();
|
||||
Vec3d scale = transformation.get_scaling_factor();
|
||||
//rotation(2) = 0.f;
|
||||
Transform3d new_matrix = Geometry::assemble_transform(Vec3d::Zero(), rotation, scale, mirror);
|
||||
Transform3d new_matrix = transformation.get_matrix_no_offset();
|
||||
|
||||
pts.reserve(its.vertices.size());
|
||||
// Using the shared vertices should be a bit quicker than using the STL faces.
|
||||
|
@ -3217,10 +3213,10 @@ void ModelInstance::get_arrange_polygon(void *ap, const Slic3r::DynamicPrintConf
|
|||
|
||||
Vec3d rotation = get_rotation();
|
||||
rotation.z() = 0.;
|
||||
Transform3d trafo_instance =
|
||||
Geometry::assemble_transform(get_offset().z() * Vec3d::UnitZ(), rotation, get_scaling_factor(), get_mirror());
|
||||
|
||||
Polygon p = get_object()->convex_hull_2d(trafo_instance);
|
||||
Geometry::Transformation t(m_transformation);
|
||||
t.set_offset(get_offset().z() * Vec3d::UnitZ());
|
||||
t.set_rotation(rotation);
|
||||
Polygon p = get_object()->convex_hull_2d(t.get_matrix());
|
||||
|
||||
// if (!p.points.empty()) {
|
||||
// Polygons pp{p};
|
||||
|
|
Loading…
Reference in a new issue