Enhanced hollowing scheme, closing distance working as expected.

This commit is contained in:
tamasmeszaros 2019-11-08 16:51:43 +01:00
parent 4b08865809
commit ac8eab5fa8
10 changed files with 160 additions and 165 deletions

View file

@ -600,7 +600,7 @@ void GLGizmoHollow::hollow_mesh()
TriangleMesh cavity = sla::generate_interior(*m_mesh,
double(m_offset),
double(m_accuracy),
double(m_smoothness));
double(m_closing_d));
if (cavity.empty()) return;
@ -753,7 +753,6 @@ RENDER_AGAIN:
// m_imgui->text(" "); // vertical gap
m_imgui->text("Offset: ");
ImGui::SameLine();
ImGui::SliderFloat(" ", &m_offset, 0.f, 10.f, "%.1f");
@ -763,10 +762,9 @@ RENDER_AGAIN:
ImGui::SameLine();
ImGui::SliderFloat(" ", &m_accuracy, 0.f, 1.f, "%.1f");
// TODO: only in expert mode:
m_imgui->text("Smoothness: ");
m_imgui->text("Closing distance: ");
ImGui::SameLine();
ImGui::SliderFloat(" ", &m_smoothness, 0.f, 1.f, "%.1f");
ImGui::SliderFloat(" ", &m_closing_d, 0.f, 20.f, "%.1f");
}
else { // not in editing mode:
m_imgui->text(m_desc.at("minimal_distance"));

View file

@ -109,18 +109,15 @@ private:
std::vector<sla::SupportPoint> m_normal_cache; // to restore after discarding changes or undo/redo
float m_offset = 2.0f;
float m_accuracy = 0.5f;
float m_closing_d = 2.f;
float m_clipping_plane_distance = 0.f;
std::unique_ptr<ClippingPlane> m_clipping_plane;
float m_accuracy = 0.5f;
// This map holds all translated description texts, so they can be easily referenced during layout calculations
// etc. When language changes, GUI is recreated and this class constructed again, so the change takes effect.
std::map<std::string, wxString> m_desc;
float m_smoothness = 0.5f;
GLSelectionRectangle m_selection_rectangle;