FIX: Difference in autoorientation between GUI and CLI

jira: STUDIO-10894

github: #6121,#6092

Change-Id: I0afb3043cdc60d22edd1ac6139fb64e794d61366
This commit is contained in:
hao.jiang 2025-05-08 16:11:40 +08:00 committed by lane.wei
parent 09c9493fc4
commit 3ed6c0a7b2
3 changed files with 11 additions and 2 deletions

View File

@ -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="<<o->id().id<<std::endl;
if (!load_process_config.empty())
{
o->config.assign_config(load_process_config);
}
orientation::orient(o);
oriented_or_arranged = true;
}

View File

@ -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;

View File

@ -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;