feat(v3.2): 3MF format import/export

This commit is contained in:
茂之钳
2026-07-24 11:30:36 +00:00
parent decb866097
commit a8052c5aae
5 changed files with 697 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
#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