OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
TextureToColor.hpp File Reference
#include "Callbacks.hpp"
#include "libslic3r/Point.hpp"
#include "TriMesh.hpp"
#include "opencv2/core.hpp"
#include <cstddef>
#include <array>
#include <functional>
#include <opencv2/core/mat.hpp>
#include <string>
#include <vector>
Include dependency graph for TextureToColor.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Slic3r::tex2color::TextureToColorSettings

Namespaces

namespace  cv
namespace  Slic3r
 |/ Copyright (c) Prusa Research 2020 - 2023 Enrico Turri @enricoturri1966 |/ |/ PrusaSlicer is released under the terms of the AGPLv3 or higher |/
namespace  Slic3r::tex2color

Typedefs

using Slic3r::tex2color::MeshRepairCallback

Enumerations

enum class  Slic3r::tex2color::MeshRepairDecision { Slic3r::tex2color::Ask , Slic3r::tex2color::ImportWithoutRepair , Slic3r::tex2color::RepairAndImport }

Functions

bool Slic3r::tex2color::TextureToColor (const TriMesh &texture_mesh, const std::vector< std::vector< Vec2f > > &uv_coords, const cv::Mat &texture, TriMesh &color_mesh, std::vector< std::array< std::size_t, 3 > > &face_colors, const TextureToColorSettings &settings=TextureToColorSettings(), AlgoProgressCallback progress_callback=nullptr, AlgoCancelCallback cancel_callback=nullptr)
 将纹理贴图转换为网格面片颜色, 并通过聚类和光顺生成可用于多色打印的着色网格
bool Slic3r::tex2color::ClusterAndSmooth (const TriMesh &mesh, const std::vector< std::array< std::size_t, 3 > > &input_face_colors, TriMesh &out_mesh, std::vector< std::array< std::size_t, 3 > > &out_face_colors, const TextureToColorSettings &settings=TextureToColorSettings(), AlgoProgressCallback progress_callback=nullptr, AlgoCancelCallback cancel_callback=nullptr, const std::vector< std::array< float, 4 > > &vertex_colors={})
 Turn pre-computed per-face colors into a clustered color mesh (no texture/UV).

Class Documentation

◆ Slic3r::tex2color::TextureToColorSettings

struct Slic3r::tex2color::TextureToColorSettings
Class Members
size_t max_cluster_k = 32
double max_color_distance = 25.0
MeshRepairCallback mesh_repair_callback
MeshRepairDecision mesh_repair_decision = MeshRepairDecision::ImportWithoutRepair
bool * mesh_repair_decision_required = nullptr
size_t oversampling_iters = 0
size_t oversampling_max_face_count = 1000000
size_t oversampling_min_face_count = 10000
double smooth_weight = 0.5
size_t target_colors_num = 4