diff --git a/src/libslic3r/Geometry.hpp b/src/libslic3r/Geometry.hpp index 1043ae12b9..8f86548ac9 100644 --- a/src/libslic3r/Geometry.hpp +++ b/src/libslic3r/Geometry.hpp @@ -309,36 +309,6 @@ bool liang_barsky_line_clipping( return liang_barsky_line_clipping(x0clip, x1clip, bbox); } -// Ugly named variant, that accepts the squared line -// Don't call me with a nearly zero length vector! -template -int ray_circle_intersections_r2_lv2_c(T r2, T a, T b, T lv2, T c, std::pair, Eigen::Matrix> &out) -{ - T d = r2 - c * c / lv2; - if (d < T(0)) - return 0; - T x0 = - a * c / lv2; - T y0 = - b * c / lv2; - T mult = sqrt(d / lv2); - out.first.x() = x0 + b * mult; - out.first.y() = y0 - a * mult; - out.second.x() = x0 - b * mult; - out.second.y() = y0 + a * mult; - return mult == T(0) ? 1 : 2; -} -template -int ray_circle_intersections(T r, T a, T b, T c, std::pair, Eigen::Matrix> &out) -{ - T lv2 = a * a + b * b; - if (lv2 < T(SCALED_EPSILON * SCALED_EPSILON)) { - //FIXME what is the correct epsilon? - // What if the line touches the circle? - return false; - } - return ray_circle_intersections_r2_lv2_c(r * r, a, b, a * a + b * b, c, out); -} - -Pointf3s convex_hull(Pointf3s points); Polygon convex_hull(Points points); Polygon convex_hull(const Polygons &polygons); diff --git a/src/libslic3r/Geometry/Circle.hpp b/src/libslic3r/Geometry/Circle.hpp index 94f756133a..6bce435bb9 100644 --- a/src/libslic3r/Geometry/Circle.hpp +++ b/src/libslic3r/Geometry/Circle.hpp @@ -239,7 +239,7 @@ int ray_circle_intersections(T r, T a, T b, T c, std::pair +#include #include #include "VectorUtils.hpp" #include "PointUtils.hpp" diff --git a/src/libslic3r/SLA/SupportIslands/ParabolaUtils.cpp b/src/libslic3r/SLA/SupportIslands/ParabolaUtils.cpp index c7e076117b..d97b07bb49 100644 --- a/src/libslic3r/SLA/SupportIslands/ParabolaUtils.cpp +++ b/src/libslic3r/SLA/SupportIslands/ParabolaUtils.cpp @@ -4,8 +4,8 @@ // sampling parabola #include -#include -#include +#include +#include using namespace Slic3r::sla; diff --git a/src/libslic3r/SLA/SupportIslands/SampleIslandUtils.cpp b/src/libslic3r/SLA/SupportIslands/SampleIslandUtils.cpp index 6bf7bf07d0..20d5486414 100644 --- a/src/libslic3r/SLA/SupportIslands/SampleIslandUtils.cpp +++ b/src/libslic3r/SLA/SupportIslands/SampleIslandUtils.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include #include "IStackFunction.hpp" #include "EvaluateNeighbor.hpp" #include "ParabolaUtils.hpp" @@ -11,7 +11,7 @@ #include "LineUtils.hpp" #include "PointUtils.hpp" -#include +#include #include // allign diff --git a/src/libslic3r/SLA/SupportIslands/VoronoiGraph.hpp b/src/libslic3r/SLA/SupportIslands/VoronoiGraph.hpp index 63c8629343..325a1eee32 100644 --- a/src/libslic3r/SLA/SupportIslands/VoronoiGraph.hpp +++ b/src/libslic3r/SLA/SupportIslands/VoronoiGraph.hpp @@ -3,6 +3,7 @@ #include #include +#include #include namespace Slic3r::sla { diff --git a/src/libslic3r/SLA/SupportIslands/VoronoiGraphUtils.cpp b/src/libslic3r/SLA/SupportIslands/VoronoiGraphUtils.cpp index 5994a34efd..c62b7ae505 100644 --- a/src/libslic3r/SLA/SupportIslands/VoronoiGraphUtils.cpp +++ b/src/libslic3r/SLA/SupportIslands/VoronoiGraphUtils.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include #include "IStackFunction.hpp" #include "EvaluateNeighbor.hpp" #include "ParabolaUtils.hpp" @@ -10,7 +10,7 @@ #include "PointUtils.hpp" #include "PolygonUtils.hpp" -#include +#include // comment definition of NDEBUG to enable assert() //#define NDEBUG diff --git a/tests/sla_print/sla_supptgen_tests.cpp b/tests/sla_print/sla_supptgen_tests.cpp index 72ae2ef96e..ab93165c9d 100644 --- a/tests/sla_print/sla_supptgen_tests.cpp +++ b/tests/sla_print/sla_supptgen_tests.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include @@ -350,10 +351,7 @@ ExPolygons createTestIslands(double size) if (useFrogLeg) { TriangleMesh mesh = load_model("frog_legs.obj"); - TriangleMeshSlicer slicer{&mesh}; - std::vector grid({0.1f}); - std::vector slices; - slicer.slice(grid, SlicingMode::Regular, 0.05f, &slices, [] {}); + std::vector slices = slice_mesh_ex(mesh.its, {0.1f}); ExPolygon frog_leg = slices.front()[1]; result.push_back(frog_leg); } @@ -481,14 +479,12 @@ SampleConfig create_sample_config(double size) { } #include -#include +#include TEST_CASE("Sampling speed test on FrogLegs", "[hide], [VoronoiSkeleton]") { TriangleMesh mesh = load_model("frog_legs.obj"); - TriangleMeshSlicer slicer{&mesh}; std::vector grid({0.1f}); - std::vector slices; - slicer.slice(grid, SlicingMode::Regular, 0.05f, &slices, [] {}); + std::vector slices = slice_mesh_ex(mesh.its, {0.1f}); ExPolygon frog_leg = slices.front()[1]; SampleConfig cfg = create_sample_config(3e7); diff --git a/tests/sla_print/sla_voronoi_graph_tests.cpp b/tests/sla_print/sla_voronoi_graph_tests.cpp index 4f0440b4e1..be875e3a8d 100644 --- a/tests/sla_print/sla_voronoi_graph_tests.cpp +++ b/tests/sla_print/sla_voronoi_graph_tests.cpp @@ -1,6 +1,6 @@ #include "sla_test_utils.hpp" #include -#include +#include using namespace Slic3r; using namespace Slic3r::sla;