28 lines
828 B
C++
28 lines
828 B
C++
#pragma once
|
|
#include "vde/mesh/halfedge_mesh.h"
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace vde::foundation {
|
|
|
|
/// 3MF mesh data with optional vertex colors
|
|
struct ThreeMFMesh {
|
|
mesh::HalfedgeMesh mesh;
|
|
std::string name;
|
|
std::vector<float> vertex_colors; ///< optional RGB per vertex (3*nv floats)
|
|
};
|
|
|
|
/// Read a 3MF file and return all meshes
|
|
[[nodiscard]] std::vector<ThreeMFMesh> read_3mf(const std::string& filepath);
|
|
|
|
/// Write meshes to a 3MF file
|
|
/// @param filepath Output .3mf file
|
|
/// @param meshes Mesh list to export
|
|
/// @param creator Application name (stored in metadata)
|
|
/// @return true on success
|
|
bool write_3mf(const std::string& filepath,
|
|
const std::vector<ThreeMFMesh>& meshes,
|
|
const std::string& creator = "ViewDesignEngine");
|
|
|
|
} // namespace vde::foundation
|