Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix few mirror related issues #5827

Merged
merged 2 commits into from
Jun 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions src/libslic3r/Model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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};
Expand Down
Loading