mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -06:00
Trying to engage support creation when the gizmo gets disabled.
This commit is contained in:
parent
a49b506121
commit
22c9c5ae95
11 changed files with 76 additions and 33 deletions
|
@ -11,6 +11,8 @@
|
|||
#include <igl/unproject_onto_mesh.h>
|
||||
#include <GL/glew.h>
|
||||
|
||||
#include <SLA/SLASupportTree.hpp>
|
||||
|
||||
#include <iostream>
|
||||
#include <numeric>
|
||||
|
||||
|
@ -1599,6 +1601,29 @@ void GLGizmoSlaSupports::update_mesh()
|
|||
}
|
||||
}
|
||||
|
||||
void GLGizmoSlaSupports::on_deactivate() {
|
||||
if(!m_model_object) return;
|
||||
|
||||
sla::Controller supportctl;
|
||||
std::cout << "Generating supports:" << std::endl;
|
||||
|
||||
// TODO: somehow get the global status indicator
|
||||
supportctl.statuscb = [] (unsigned st, const std::string& msg) {
|
||||
std::cout << st << "% " << msg << std::endl;
|
||||
};
|
||||
|
||||
const Model& model = *m_model_object->get_model();
|
||||
auto emesh = sla::to_eigenmesh(model);
|
||||
sla::PointSet input = sla::support_points(model);
|
||||
sla::SupportConfig cfg;
|
||||
|
||||
sla::SLASupportTree stree(input, emesh, cfg, supportctl);
|
||||
|
||||
TriangleMesh output;
|
||||
stree.merged_mesh(output);
|
||||
m_model_object->add_volume(output);
|
||||
}
|
||||
|
||||
Vec3f GLGizmoSlaSupports::unproject_on_mesh(const Vec2d& mouse_pos)
|
||||
{
|
||||
// if the gizmo doesn't have the V, F structures for igl, calculate them first:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue