Add new bake pipeline

This commit is contained in:
ExPikaPaka
2026-09-03 09:13:14 +02:00
parent 96f2c8e698
commit 3aefae016f
21 changed files with 2913 additions and 28 deletions
@@ -0,0 +1,25 @@
#include "TextureBakeIndex.hpp"
#include <algorithm>
namespace Slic3r {
namespace TextureBake {
WeldResult weld_vertices(const std::vector<Vec3f> &positions, double quant)
{
WeldResult out;
QuantizedPointMap map(quant, std::min<size_t>(positions.size(), size_t(1) << 22));
out.vertex_id.resize(positions.size());
int next_id = 0;
for (size_t i = 0; i < positions.size(); ++i) {
const int id = map.get_or_set(positions[i], next_id);
if (map.inserted())
++next_id;
out.vertex_id[i] = id;
}
out.unique_count = next_id;
return out;
}
} // namespace TextureBake
} // namespace Slic3r