diff --git a/src/libslic3r/Measure.cpp b/src/libslic3r/Measure.cpp index cdde276dd..1a79369a3 100644 --- a/src/libslic3r/Measure.cpp +++ b/src/libslic3r/Measure.cpp @@ -106,7 +106,7 @@ void MeasuringImpl::update_planes() int facet_idx = facet_queue[-- facet_queue_cnt]; const stl_normal& this_normal = face_normals[facet_idx]; if (is_same_normal(this_normal, *normal_ptr)) { - const Vec3i& face = m_its.indices[facet_idx]; +// const Vec3i& face = m_its.indices[facet_idx]; m_face_to_plane[facet_idx] = m_planes.size() - 1; m_planes.back().facets.emplace_back(facet_idx); @@ -132,7 +132,7 @@ void MeasuringImpl::update_planes() for (int face_id=0; face_id lengths; - for (int i=0; i M_PI) @@ -236,10 +236,10 @@ void MeasuringImpl::extract_features() bool circle = false; std::vector circles; std::vector> circles_idxs; - for (int i=1; i polygon_lower_threshold) { if (angle < polygon_upper_threshold) { const Vec3d center = std::get<0>(circles[i].get_circle()); - for (int j=circles_idxs[i].first + 1; j<=circles_idxs[i].second; ++j) + for (int j=(int)circles_idxs[i].first + 1; j<=(int)circles_idxs[i].second; ++j) plane.surface_features.emplace_back(SurfaceFeature(SurfaceFeatureType::Edge, border[j-1], border[j], std::make_optional(center), 0.)); } else { @@ -286,7 +286,7 @@ void MeasuringImpl::extract_features() // We have the circles. Now go around again and pick edges. int cidx = 0; // index of next circle in the way for (int i=1; i circles_idxs[cidx].first) + if (cidx < (int)circles_idxs.size() && i > (int)circles_idxs[cidx].first) i = circles_idxs[cidx++].second; else plane.surface_features.emplace_back(SurfaceFeature( SurfaceFeatureType::Edge, border[i-1], border[i], std::optional(), 0.)); diff --git a/src/libslic3r/Measure.hpp b/src/libslic3r/Measure.hpp index 95d8f34cb..9e3629589 100644 --- a/src/libslic3r/Measure.hpp +++ b/src/libslic3r/Measure.hpp @@ -68,7 +68,7 @@ private: Vec3d m_pt1; Vec3d m_pt2; std::optional m_pt3; - double m_value; + double m_value{ 0.0 }; }; diff --git a/src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp b/src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp index 13415e70a..54c944590 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoMeasure.cpp @@ -200,6 +200,7 @@ void GLGizmoMeasure::on_render() return; switch (m_curr_feature->get_type()) { + default: { assert(false); break; } case Measure::SurfaceFeatureType::Point: { m_raycasters.insert({ POINT_ID, m_parent.add_raycaster_for_picking(SceneRaycaster::EType::Gizmo, POINT_ID, *m_sphere.mesh_raycaster) }); @@ -265,6 +266,7 @@ void GLGizmoMeasure::on_render() else if (is_hovering_on_extended_selection) { switch (m_curr_feature->get_type()) { + default: { assert(false); break; } case Measure::SurfaceFeatureType::Point: { m_curr_ex_feature_position = model_matrix * m_curr_feature->get_point(); @@ -342,7 +344,9 @@ void GLGizmoMeasure::on_render() shader->set_uniform("view_normal_matrix", view_normal_matrix); }; - switch (m_curr_feature->get_type()) { + switch (m_curr_feature->get_type()) + { + default: { assert(false); break; } case Measure::SurfaceFeatureType::Point: { const Vec3d& position = m_curr_feature->get_point(); @@ -552,6 +556,7 @@ void GLGizmoMeasure::on_render_input_window(float x, float y, float bottom_limit if (ImGui::BeginTable("Data", 2)) { switch (feature_type) { + default: { assert(false); break; } case Measure::SurfaceFeatureType::Point: { const Vec3d position = volume_matrix * m_curr_feature->get_point();