mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-24 17:21:11 -06:00
Drill holes one by one and display warning of any of them fails
Drill with cgal::minus for now
This commit is contained in:
parent
d0febbec32
commit
4b9de0398f
5 changed files with 54 additions and 29 deletions
|
|
@ -125,6 +125,8 @@ void GLGizmoHollow::render_points(const Selection& selection, bool picking) cons
|
|||
float render_color[4];
|
||||
const sla::DrainHoles& drain_holes = m_c->selection_info()->model_object()->sla_drain_holes;
|
||||
size_t cache_size = drain_holes.size();
|
||||
|
||||
const auto *hollowed_mesh = m_c->hollowed_mesh();
|
||||
for (size_t i = 0; i < cache_size; ++i)
|
||||
{
|
||||
const sla::DrainHole& drain_hole = drain_holes[i];
|
||||
|
|
@ -136,6 +138,13 @@ void GLGizmoHollow::render_points(const Selection& selection, bool picking) cons
|
|||
// First decide about the color of the point.
|
||||
if (picking) {
|
||||
std::array<float, 4> color = picking_color_component(i);
|
||||
|
||||
if (hollowed_mesh && i < hollowed_mesh->get_drainholes().size() && hollowed_mesh->get_drainholes()[i].failed) {
|
||||
render_color[0] = 1.f;
|
||||
render_color[1] = 1.f;
|
||||
render_color[2] = 0.f;
|
||||
render_color[3] = color[3];
|
||||
}
|
||||
render_color[0] = color[0];
|
||||
render_color[1] = color[1];
|
||||
render_color[2] = color[2];
|
||||
|
|
@ -149,9 +158,15 @@ void GLGizmoHollow::render_points(const Selection& selection, bool picking) cons
|
|||
render_color[2] = 1.0f;
|
||||
}
|
||||
else { // neigher hover nor picking
|
||||
render_color[0] = point_selected ? 1.0f : 0.7f;
|
||||
render_color[1] = point_selected ? 0.3f : 0.7f;
|
||||
render_color[2] = point_selected ? 0.3f : 0.7f;
|
||||
if (hollowed_mesh && i < hollowed_mesh->get_drainholes().size() && hollowed_mesh->get_drainholes()[i].failed) {
|
||||
render_color[0] = 1.f;
|
||||
render_color[1] = 1.f;
|
||||
render_color[2] = 0.f;
|
||||
} else {
|
||||
render_color[0] = point_selected ? 1.0f : 0.7f;
|
||||
render_color[1] = point_selected ? 0.3f : 0.7f;
|
||||
render_color[2] = point_selected ? 0.3f : 0.7f;
|
||||
}
|
||||
render_color[3] = 0.5f;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -205,6 +205,7 @@ void HollowedMesh::on_update()
|
|||
m_hollowed_mesh_transformed.reset(new TriangleMesh(backend_mesh));
|
||||
Transform3d trafo_inv = canvas->sla_print()->sla_trafo(*mo).inverse();
|
||||
m_hollowed_mesh_transformed->transform(trafo_inv);
|
||||
m_drainholes = print_object->model_object()->sla_drain_holes;
|
||||
m_old_hollowing_timestamp = timestamp;
|
||||
|
||||
const TriangleMesh &interior = print_object->hollowed_interior_mesh();
|
||||
|
|
@ -215,8 +216,9 @@ void HollowedMesh::on_update()
|
|||
m_hollowed_interior_transformed->transform(trafo_inv);
|
||||
}
|
||||
}
|
||||
else
|
||||
else {
|
||||
m_hollowed_mesh_transformed.reset(nullptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
#include <map>
|
||||
|
||||
#include "slic3r/GUI/MeshUtils.hpp"
|
||||
#include "libslic3r/SLA/Hollowing.hpp"
|
||||
|
||||
namespace Slic3r {
|
||||
|
||||
|
|
@ -198,6 +199,8 @@ public:
|
|||
CommonGizmosDataID get_dependencies() const override { return CommonGizmosDataID::SelectionInfo; }
|
||||
#endif // NDEBUG
|
||||
|
||||
const sla::DrainHoles &get_drainholes() const { return m_drainholes; }
|
||||
|
||||
const TriangleMesh* get_hollowed_mesh() const;
|
||||
const TriangleMesh* get_hollowed_interior() const;
|
||||
|
||||
|
|
@ -211,6 +214,7 @@ private:
|
|||
size_t m_old_hollowing_timestamp = 0;
|
||||
int m_print_object_idx = -1;
|
||||
int m_print_objects_count = 0;
|
||||
sla::DrainHoles m_drainholes;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue