mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-12 17:09:05 +08:00
Fixes of bad merges during rebase
Add missing includes into CMakeLists IndexMesh change to AABBMesh construct_voronoi become class function
This commit is contained in:
parent
7216e819b3
commit
54bc516da6
@ -1,4 +1,4 @@
|
||||
#/|/ Copyright (c) Prusa Research 2018 - 2023 Tom<EFBFBD> M<EFBFBD>sz<EFBFBD>ros @tamasmeszaros, Oleksandra Iushchenko @YuSanka, Enrico Turri @enricoturri1966, Vojt<EFBFBD>ch Bubn<EFBFBD>k @bubnikv, Pavel Miku<EFBFBD> @Godrak, Luk<EFBFBD> Hejl @hejllukas, Luk<EFBFBD> Mat<EFBFBD>na @lukasmatena, Filip Sykala @Jony01, David Koc<EFBFBD>k @kocikdav, Vojt<EFBFBD>ch Kr<EFBFBD>l @vojtechkral
|
||||
#/|/ Copyright (c) Prusa Research 2018 - 2023 Tomáš Mészáros @tamasmeszaros, Oleksandra Iushchenko @YuSanka, Enrico Turri @enricoturri1966, Vojtěch Bubník @bubnikv, Pavel Mikuš @Godrak, Lukáš Hejl @hejllukas, Lukáš Matěna @lukasmatena, Filip Sykala @Jony01, David Kocík @kocikdav, Vojtěch Král @vojtechkral
|
||||
#/|/ Copyright (c) BambuStudio 2023 manch1n @manch1n
|
||||
#/|/ Copyright (c) 2023 Mimoja @Mimoja
|
||||
#/|/ Copyright (c) 2022 ole00 @ole00
|
||||
@ -458,12 +458,27 @@ set(SLIC3R_SOURCES
|
||||
SLA/SupportIslands/ExpandNeighbor.cpp
|
||||
SLA/SupportIslands/ExpandNeighbor.hpp
|
||||
SLA/SupportIslands/IStackFunction.hpp
|
||||
SLA/SupportIslands/LineUtils.cpp
|
||||
SLA/SupportIslands/LineUtils.hpp
|
||||
SLA/SupportIslands/NodeDataWithResult.hpp
|
||||
SLA/SupportIslands/Parabola.hpp
|
||||
SLA/SupportIslands/ParabolaUtils.cpp
|
||||
SLA/SupportIslands/ParabolaUtils.hpp
|
||||
SLA/SupportIslands/PointUtils.cpp
|
||||
SLA/SupportIslands/PointUtils.hpp
|
||||
SLA/SupportIslands/PolygonUtils.cpp
|
||||
SLA/SupportIslands/PolygonUtils.hpp
|
||||
SLA/SupportIslands/PostProcessNeighbor.cpp
|
||||
SLA/SupportIslands/PostProcessNeighbor.hpp
|
||||
SLA/SupportIslands/PostProcessNeighbors.cpp
|
||||
SLA/SupportIslands/PostProcessNeighbors.hpp
|
||||
SLA/SupportIslands/SampleConfig.hpp
|
||||
SLA/SupportIslands/SampleConfigFactory.hpp
|
||||
SLA/SupportIslands/SampleIslandUtils.cpp
|
||||
SLA/SupportIslands/SampleIslandUtils.hpp
|
||||
SLA/SupportIslands/SupportIslandPoint.cpp
|
||||
SLA/SupportIslands/SupportIslandPoint.hpp
|
||||
SLA/SupportIslands/VectorUtils.hpp
|
||||
SLA/SupportIslands/VoronoiGraph.hpp
|
||||
SLA/SupportIslands/VoronoiGraphUtils.cpp
|
||||
SLA/SupportIslands/VoronoiGraphUtils.hpp
|
||||
|
@ -1,9 +1,9 @@
|
||||
///|/ Copyright (c) Prusa Research 2016 - 2023 Vojt<EFBFBD>ch Bubn<62>k @bubnikv, Enrico Turri @enricoturri1966, Tom<6F> M<>sz<73>ros @tamasmeszaros, Luk<75> Mat<61>na @lukasmatena, Filip Sykala @Jony01, Luk<75> Hejl @hejllukas
|
||||
///|/ Copyright (c) Prusa Research 2016 - 2023 Vojtěch Bubník @bubnikv, Enrico Turri @enricoturri1966, Tomáš Mészáros @tamasmeszaros, Lukáš Matěna @lukasmatena, Filip Sykala @Jony01, Lukáš Hejl @hejllukas
|
||||
///|/ Copyright (c) 2017 Eyal Soha @eyal0
|
||||
///|/ Copyright (c) Slic3r 2013 - 2016 Alessandro Ranellucci @alranel
|
||||
///|/
|
||||
///|/ ported from lib/Slic3r/Geometry.pm:
|
||||
///|/ Copyright (c) Prusa Research 2017 - 2022 Vojt<EFBFBD>ch Bubn<62>k @bubnikv
|
||||
///|/ Copyright (c) Prusa Research 2017 - 2022 Vojtěch Bubník @bubnikv
|
||||
///|/ Copyright (c) Slic3r 2011 - 2015 Alessandro Ranellucci @alranel
|
||||
///|/ Copyright (c) 2013 Jose Luis Perez Diez
|
||||
///|/ Copyright (c) 2013 Anders Sundman
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include "VectorUtils.hpp"
|
||||
#include "LineUtils.hpp"
|
||||
#include "PointUtils.hpp"
|
||||
|
||||
#include "libslic3r/Geometry/Voronoi.hpp"
|
||||
#include <libslic3r/Geometry/VoronoiVisualUtils.hpp>
|
||||
|
||||
#include <libslic3r/ClipperUtils.hpp> // allign
|
||||
@ -388,9 +388,14 @@ std::vector<std::set<const VoronoiGraph::Node *>> create_circles_sets(
|
||||
}
|
||||
|
||||
Slic3r::Points SampleIslandUtils::to_points(const SupportIslandPoints &support_points)
|
||||
{
|
||||
std::function<Point(const std::unique_ptr<SupportIslandPoint> &)> transform_func = &SupportIslandPoint::point;
|
||||
return VectorUtils::transform(support_points, transform_func);
|
||||
{
|
||||
Points result;
|
||||
result.reserve(support_points.size());
|
||||
std::transform(support_points.begin(), support_points.end(), std::back_inserter(result),
|
||||
[](const std::unique_ptr<SupportIslandPoint> &p) { return p->point; });
|
||||
return result;
|
||||
//std::function<Point(const std::unique_ptr<SupportIslandPoint> &)> transform_func = &SupportIslandPoint::point;
|
||||
//return VectorUtils::transform(support_points, transform_func);
|
||||
}
|
||||
|
||||
std::vector<Slic3r::Vec2f> SampleIslandUtils::to_points_f(const SupportIslandPoints &support_points)
|
||||
@ -471,7 +476,7 @@ coord_t SampleIslandUtils::align_once(SupportIslandPoints &samples,
|
||||
#endif // SLA_SAMPLE_ISLAND_UTILS_STORE_ALIGN_ONCE_TO_SVG
|
||||
|
||||
// create voronoi diagram with points
|
||||
construct_voronoi(points.begin(), points.end(), &vd);
|
||||
vd.construct_voronoi(points.begin(), points.end());
|
||||
#ifdef SLA_SAMPLE_ISLAND_UTILS_STORE_ALIGNE_VD_TO_SVG
|
||||
static int vd_counter = 0;
|
||||
BoundingBox bbox(island);
|
||||
|
@ -2304,7 +2304,7 @@ TEST_CASE("bad vertex cause overflow of data type precisin when use VD result",
|
||||
|
||||
using VD = Slic3r::Geometry::VoronoiDiagram;
|
||||
VD vd;
|
||||
construct_voronoi(points.begin(), points.end(), &vd);
|
||||
vd.construct_voronoi(points.begin(), points.end());
|
||||
|
||||
// edge between source index 0 and 1 has bad vertex
|
||||
size_t bad_index0 = 0;
|
||||
|
@ -491,7 +491,7 @@ TEST_CASE("Sampling speed test on FrogLegs", "[hide], [VoronoiSkeleton]")
|
||||
using VD = Slic3r::Geometry::VoronoiDiagram;
|
||||
VD vd;
|
||||
Lines lines = to_lines(frog_leg);
|
||||
construct_voronoi(lines.begin(), lines.end(), &vd);
|
||||
vd.construct_voronoi(lines.begin(), lines.end());
|
||||
Slic3r::Voronoi::annotate_inside_outside(vd, lines);
|
||||
|
||||
for (int i = 0; i < 100; ++i) {
|
||||
@ -513,7 +513,7 @@ TEST_CASE("Speed align", "[hide], [VoronoiSkeleton]")
|
||||
using VD = Slic3r::Geometry::VoronoiDiagram;
|
||||
VD vd;
|
||||
Lines lines = to_lines(island);
|
||||
construct_voronoi(lines.begin(), lines.end(), &vd);
|
||||
vd.construct_voronoi(lines.begin(), lines.end());
|
||||
Slic3r::Voronoi::annotate_inside_outside(vd, lines);
|
||||
VoronoiGraph::ExPath longest_path;
|
||||
VoronoiGraph skeleton = VoronoiGraphUtils::create_skeleton(vd, lines);
|
||||
@ -604,8 +604,8 @@ TEST_CASE("Small islands should be supported in center", "[SupGen], [VoronoiSkel
|
||||
std::vector<Vec2f> sample_old(const ExPolygon &island)
|
||||
{
|
||||
// Create the support point generator
|
||||
static TriangleMesh mesh;
|
||||
static sla::IndexedMesh emesh{mesh};
|
||||
static TriangleMesh mesh;
|
||||
static AABBMesh emesh(mesh);
|
||||
static sla::SupportPointGenerator::Config autogencfg;
|
||||
//autogencfg.minimal_distance = 8.f;
|
||||
static sla::SupportPointGenerator generator{emesh, autogencfg, [] {}, [](int) {}};
|
||||
@ -616,7 +616,7 @@ std::vector<Vec2f> sample_old(const ExPolygon &island)
|
||||
coordf_t print_z = 11.f;
|
||||
SupportPointGenerator::MyLayer layer(layer_id, print_z);
|
||||
ExPolygon poly = island;
|
||||
BoundingBox bbox(island);
|
||||
BoundingBox bbox(island.contour.points);
|
||||
Vec2f centroid;
|
||||
float area = island.area();
|
||||
float h = 17.f;
|
||||
@ -653,7 +653,7 @@ std::vector<Vec2f> sample_filip(const ExPolygon &island)
|
||||
void store_sample(const std::vector<Vec2f> &samples, const ExPolygon& island)
|
||||
{
|
||||
static int counter = 0;
|
||||
BoundingBox bb(island);
|
||||
BoundingBox bb(island.contour.points);
|
||||
SVG svg(("sample_"+std::to_string(counter++)+".svg").c_str(), bb);
|
||||
|
||||
double mm = scale_(1);
|
||||
|
@ -36,7 +36,7 @@ TEST_CASE("Convert coordinate datatype", "[Voronoi]")
|
||||
void check(Slic3r::Points points, double max_distance) {
|
||||
using VD = Slic3r::Geometry::VoronoiDiagram;
|
||||
VD vd;
|
||||
construct_voronoi(points.begin(), points.end(), &vd);
|
||||
vd.construct_voronoi(points.begin(), points.end());
|
||||
double max_area = M_PI * max_distance*max_distance; // circle = Pi * r^2
|
||||
for (const VD::cell_type &cell : vd.cells()) {
|
||||
Slic3r::Polygon polygon = VoronoiGraphUtils::to_polygon(cell, points, max_distance);
|
||||
|
Loading…
x
Reference in New Issue
Block a user