Fix for bad arrange with mirrored objects
This commit is contained in:
parent
b099d5c05e
commit
8a3d2f385f
@ -511,8 +511,9 @@ ShapeData2D projectModelFromTop(const Slic3r::Model &model) {
|
|||||||
ModelInstance * finst = objptr->instances.front();
|
ModelInstance * finst = objptr->instances.front();
|
||||||
|
|
||||||
// Object instances should carry the same scaling and
|
// Object instances should carry the same scaling and
|
||||||
// x, y rotation that is why we use the first instance
|
// x, y rotation that is why we use the first instance.
|
||||||
rmesh.scale(finst->get_scaling_factor());
|
// The next line will apply only the full mirroring and scaling
|
||||||
|
rmesh.transform(finst->get_matrix(true, true, false, false));
|
||||||
rmesh.rotate_x(float(finst->get_rotation()(X)));
|
rmesh.rotate_x(float(finst->get_rotation()(X)));
|
||||||
rmesh.rotate_y(float(finst->get_rotation()(Y)));
|
rmesh.rotate_y(float(finst->get_rotation()(Y)));
|
||||||
|
|
||||||
|
@ -1117,7 +1117,9 @@ bool SLASupportTree::generate(const PointSet &points,
|
|||||||
head_norm.row(pcount) = nn;
|
head_norm.row(pcount) = nn;
|
||||||
|
|
||||||
++pcount;
|
++pcount;
|
||||||
} else {
|
} else if( polar >= 3*PI/4 ) {
|
||||||
|
// Headless supports do not tilt like the headed ones so
|
||||||
|
// the normal should point almost to the ground.
|
||||||
headless_norm.row(hlcount) = nn;
|
headless_norm.row(hlcount) = nn;
|
||||||
headless_pos.row(hlcount++) = hp;
|
headless_pos.row(hlcount++) = hp;
|
||||||
}
|
}
|
||||||
|
@ -502,8 +502,8 @@ void SLAPrint::process()
|
|||||||
po.m_supportdata.reset(new SLAPrintObject::SupportData());
|
po.m_supportdata.reset(new SLAPrintObject::SupportData());
|
||||||
po.m_supportdata->emesh = sla::to_eigenmesh(po.transformed_mesh());
|
po.m_supportdata->emesh = sla::to_eigenmesh(po.transformed_mesh());
|
||||||
|
|
||||||
BOOST_LOG_TRIVIAL(debug)
|
BOOST_LOG_TRIVIAL(debug) << "Support point count "
|
||||||
<< "Support point count " << mo.sla_support_points.size();
|
<< mo.sla_support_points.size();
|
||||||
|
|
||||||
// If there are no points on the front-end, we will do the
|
// If there are no points on the front-end, we will do the
|
||||||
// autoplacement. Otherwise we will just blindly copy the frontend data
|
// autoplacement. Otherwise we will just blindly copy the frontend data
|
||||||
@ -537,6 +537,9 @@ void SLAPrint::process()
|
|||||||
const std::vector<Vec3d>& points = auto_supports.output();
|
const std::vector<Vec3d>& points = auto_supports.output();
|
||||||
this->throw_if_canceled();
|
this->throw_if_canceled();
|
||||||
po.m_supportdata->support_points = sla::to_point_set(points);
|
po.m_supportdata->support_points = sla::to_point_set(points);
|
||||||
|
|
||||||
|
BOOST_LOG_TRIVIAL(debug) << "Automatic support points: "
|
||||||
|
<< po.m_supportdata->support_points.rows();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// There are some points on the front-end, no calculation will be done.
|
// There are some points on the front-end, no calculation will be done.
|
||||||
@ -584,13 +587,15 @@ void SLAPrint::process()
|
|||||||
|
|
||||||
// Create the unified mesh
|
// Create the unified mesh
|
||||||
auto rc = SlicingStatus::RELOAD_SCENE;
|
auto rc = SlicingStatus::RELOAD_SCENE;
|
||||||
po.m_supportdata->support_tree_ptr->merged_mesh();
|
|
||||||
|
|
||||||
// Check the mesh for later troubleshooting.
|
// This is to prevent "Done." being displayed during merged_mesh()
|
||||||
|
report_status(*this, -1, L("Visualizing supports"));
|
||||||
|
po.m_supportdata->support_tree_ptr->merged_mesh();
|
||||||
|
|
||||||
BOOST_LOG_TRIVIAL(debug) << "Processed support point count "
|
BOOST_LOG_TRIVIAL(debug) << "Processed support point count "
|
||||||
<< po.m_supportdata->support_points.rows();
|
<< po.m_supportdata->support_points.rows();
|
||||||
|
|
||||||
|
// Check the mesh for later troubleshooting.
|
||||||
if(po.support_mesh().empty())
|
if(po.support_mesh().empty())
|
||||||
BOOST_LOG_TRIVIAL(warning) << "Support mesh is empty";
|
BOOST_LOG_TRIVIAL(warning) << "Support mesh is empty";
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user