From 3ed6c0a7b22f91c5ea0e9064f041cba2a570300e Mon Sep 17 00:00:00 2001 From: "hao.jiang" Date: Thu, 8 May 2025 16:11:40 +0800 Subject: [PATCH] FIX: Difference in autoorientation between GUI and CLI jira: STUDIO-10894 github: #6121,#6092 Change-Id: I0afb3043cdc60d22edd1ac6139fb64e794d61366 --- src/BambuStudio.cpp | 4 ++++ src/libslic3r/Orient.cpp | 5 +++++ src/libslic3r/Orient.hpp | 4 ++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/BambuStudio.cpp b/src/BambuStudio.cpp index 23eddd6f7..a28b11995 100644 --- a/src/BambuStudio.cpp +++ b/src/BambuStudio.cpp @@ -4419,6 +4419,10 @@ int CLI::run(int argc, char **argv) if (orients_requirement[o->id().id]) { BOOST_LOG_TRIVIAL(info) << "Before process command, Orient object, name=" << o->name <<",id="<id().id<config.assign_config(load_process_config); + } orientation::orient(o); oriented_or_arranged = true; } diff --git a/src/libslic3r/Orient.cpp b/src/libslic3r/Orient.cpp index a8cec7097..ee152520c 100644 --- a/src/libslic3r/Orient.cpp +++ b/src/libslic3r/Orient.cpp @@ -519,6 +519,11 @@ void orient(ModelObject* obj) { auto m = obj->mesh(); AutoOrienter orienter(&m); + if (obj->config.has("support_threshold_angle")) + { + orienter.params.overhang_angle = obj->config.opt_int("support_threshold_angle"); + orienter.params.ASCENT = cos(PI - orienter.params.overhang_angle * PI / 180); + } Vec3d orientation = orienter.process(); Vec3d axis; double angle; diff --git a/src/libslic3r/Orient.hpp b/src/libslic3r/Orient.hpp index 76be064cd..71d24b160 100644 --- a/src/libslic3r/Orient.hpp +++ b/src/libslic3r/Orient.hpp @@ -102,7 +102,7 @@ struct OrientParams { float FIRST_LAY_H = 0.2f;//0.029; float VECTOR_TOL = -0.0011163303070972383f; float NEGL_FACE_SIZE = 0.1f; - float ASCENT= -0.5f; + float ASCENT= -0.86602540378f; float PLAFOND_ADV = 0.04079208948120519f; float CONTOUR_AMOUNT = 0.0101472219892684f; float OV_H = 1.0370178217794535f; @@ -119,7 +119,7 @@ struct OrientParams { float BOTTOM_HULL_MAX = 2000;// max bottom hull area to clip //600 float APPERANCE_FACE_SUPP=3; // penalty of generating supports on appearance face - float overhang_angle = 60.f; + float overhang_angle = 30.f; bool use_low_angle_face = true; bool min_volume = false; Eigen::Vector3f fun_dir;