mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-07 07:41:06 +00:00
A bake coloured anything within the relief depth of the painted area, matching it back by proximity. On a part thinner than that depth the surface nearest the opposite face is the painted one, so the texture appeared there too, and on the sides as well. Proximity cannot answer this: the result is displaced geometry, so a face is no longer where its base surface was. Inverting the relief makes a pushed-in face and the far side of a thin wall indistinguishable by distance or by normal. The pipeline now records, per face, whether the paint covered the geometry it came from. That is taken on the refined mesh, where exclude_weight still says exactly which faces the paint left out, and carried through decimation, the T-junction repair and the weld rather than sampled again. Only the painted/unpainted split is reliable in that record. The colour beside it is sampled at displaced positions while the sampler answers for the base surface, so a painted face can come back without one - FACE_NO_COLOUR, not FACE_UNPAINTED. Where to sample still comes from the base surface, as before. The old proximity test remains as a fallback when the per-face record does not line up with the output.
25 lines
971 B
C++
25 lines
971 B
C++
#pragma once
|
|
|
|
// Conversion between the pipeline's triangle soup and the indexed mesh used elsewhere. The pipeline
|
|
// stays on soup because each stage welds on its own grid, and those differences are load-bearing.
|
|
|
|
#include "TextureBakeIndex.hpp"
|
|
#include "../TriangleMesh.hpp"
|
|
#include <vector>
|
|
#include <cstdint>
|
|
|
|
namespace Slic3r {
|
|
namespace TextureBake {
|
|
|
|
// `face_excluded`: one entry per input triangle, becoming the soup's per-corner exclusion weight.
|
|
TriSoup to_soup(const indexed_triangle_set &its, const std::vector<uint8_t> &face_excluded = {});
|
|
|
|
// Welds at the geometry grid.
|
|
// `face_color`, when given, is read as one entry per soup triangle and rewritten to match the output.
|
|
// Welding can leave a triangle with no area, and those are dropped here, so the two would otherwise
|
|
// fall out of step.
|
|
indexed_triangle_set to_indexed_triangle_set(const TriSoup &soup, std::vector<int> *face_color = nullptr);
|
|
|
|
} // namespace TextureBake
|
|
} // namespace Slic3r
|