mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-31 14:02:02 +08:00
Fix build
This commit is contained in:
parent
5d2b3cfc1e
commit
209bebc82e
@ -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<typename T>
|
||||
int ray_circle_intersections_r2_lv2_c(T r2, T a, T b, T lv2, T c, std::pair<Eigen::Matrix<T, 2, 1, Eigen::DontAlign>, Eigen::Matrix<T, 2, 1, Eigen::DontAlign>> &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<typename T>
|
||||
int ray_circle_intersections(T r, T a, T b, T c, std::pair<Eigen::Matrix<T, 2, 1, Eigen::DontAlign>, Eigen::Matrix<T, 2, 1, Eigen::DontAlign>> &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);
|
||||
|
||||
|
@ -239,7 +239,7 @@ int ray_circle_intersections(T r, T a, T b, T c, std::pair<Eigen::Matrix<T, 2, 1
|
||||
// What if the line touches the circle?
|
||||
return false;
|
||||
}
|
||||
return ray_circle_intersections_r2_lv2_c2(r * r, a, b, a * a + b * b, c, out);
|
||||
return ray_circle_intersections_r2_lv2_c(r * r, a, b, a * a + b * b, c, out);
|
||||
}
|
||||
|
||||
} } // namespace Slic3r::Geometry
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "LineUtils.hpp"
|
||||
#include <libslic3r/Geometry.hpp>
|
||||
#include <libslic3r/Geometry/Circle.hpp>
|
||||
#include <functional>
|
||||
#include "VectorUtils.hpp"
|
||||
#include "PointUtils.hpp"
|
||||
|
@ -4,8 +4,8 @@
|
||||
|
||||
// sampling parabola
|
||||
#include <libslic3r/Geometry.hpp>
|
||||
#include <libslic3r/VoronoiOffset.hpp>
|
||||
#include <libslic3r/VoronoiVisualUtils.hpp>
|
||||
#include <libslic3r/Geometry/VoronoiOffset.hpp>
|
||||
#include <libslic3r/Geometry/VoronoiVisualUtils.hpp>
|
||||
|
||||
using namespace Slic3r::sla;
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include <cmath>
|
||||
#include <optional>
|
||||
#include <libslic3r/VoronoiOffset.hpp>
|
||||
#include <libslic3r/Geometry/VoronoiOffset.hpp>
|
||||
#include "IStackFunction.hpp"
|
||||
#include "EvaluateNeighbor.hpp"
|
||||
#include "ParabolaUtils.hpp"
|
||||
@ -11,7 +11,7 @@
|
||||
#include "LineUtils.hpp"
|
||||
#include "PointUtils.hpp"
|
||||
|
||||
#include <libslic3r/VoronoiVisualUtils.hpp>
|
||||
#include <libslic3r/Geometry/VoronoiVisualUtils.hpp>
|
||||
|
||||
#include <libslic3r/ClipperUtils.hpp> // allign
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
#include <map>
|
||||
#include <libslic3r/Geometry.hpp>
|
||||
#include <libslic3r/Geometry/Voronoi.hpp>
|
||||
#include <numeric>
|
||||
|
||||
namespace Slic3r::sla {
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include <cmath>
|
||||
#include <set>
|
||||
#include <libslic3r/VoronoiOffset.hpp>
|
||||
#include <libslic3r/Geometry/VoronoiOffset.hpp>
|
||||
#include "IStackFunction.hpp"
|
||||
#include "EvaluateNeighbor.hpp"
|
||||
#include "ParabolaUtils.hpp"
|
||||
@ -10,7 +10,7 @@
|
||||
#include "PointUtils.hpp"
|
||||
#include "PolygonUtils.hpp"
|
||||
|
||||
#include <libslic3r/VoronoiVisualUtils.hpp>
|
||||
#include <libslic3r/Geometry/VoronoiVisualUtils.hpp>
|
||||
|
||||
// comment definition of NDEBUG to enable assert()
|
||||
//#define NDEBUG
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include <libslic3r/BoundingBox.hpp>
|
||||
#include <libslic3r/SLA/SpatIndex.hpp>
|
||||
#include <libslic3r/ClipperUtils.hpp>
|
||||
#include <libslic3r/TriangleMeshSlicer.hpp>
|
||||
|
||||
#include <libslic3r/SLA/SupportIslands/SampleConfig.hpp>
|
||||
#include <libslic3r/SLA/SupportIslands/VoronoiGraphUtils.hpp>
|
||||
@ -350,10 +351,7 @@ ExPolygons createTestIslands(double size)
|
||||
|
||||
if (useFrogLeg) {
|
||||
TriangleMesh mesh = load_model("frog_legs.obj");
|
||||
TriangleMeshSlicer slicer{&mesh};
|
||||
std::vector<float> grid({0.1f});
|
||||
std::vector<ExPolygons> slices;
|
||||
slicer.slice(grid, SlicingMode::Regular, 0.05f, &slices, [] {});
|
||||
std::vector<ExPolygons> 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 <libslic3r/Geometry.hpp>
|
||||
#include <libslic3r/VoronoiOffset.hpp>
|
||||
#include <libslic3r/Geometry/VoronoiOffset.hpp>
|
||||
TEST_CASE("Sampling speed test on FrogLegs", "[hide], [VoronoiSkeleton]")
|
||||
{
|
||||
TriangleMesh mesh = load_model("frog_legs.obj");
|
||||
TriangleMeshSlicer slicer{&mesh};
|
||||
std::vector<float> grid({0.1f});
|
||||
std::vector<ExPolygons> slices;
|
||||
slicer.slice(grid, SlicingMode::Regular, 0.05f, &slices, [] {});
|
||||
std::vector<ExPolygons> slices = slice_mesh_ex(mesh.its, {0.1f});
|
||||
ExPolygon frog_leg = slices.front()[1];
|
||||
SampleConfig cfg = create_sample_config(3e7);
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "sla_test_utils.hpp"
|
||||
#include <libslic3r/SLA/SupportIslands/VoronoiGraphUtils.hpp>
|
||||
#include <libslic3r/VoronoiVisualUtils.hpp>
|
||||
#include <libslic3r/Geometry/VoronoiVisualUtils.hpp>
|
||||
|
||||
using namespace Slic3r;
|
||||
using namespace Slic3r::sla;
|
||||
|
Loading…
x
Reference in New Issue
Block a user