ViewDesignEngine  3.1.0
高性能 CAD 计算几何引擎
io_gltf.h
浏览该文件的文档.
1 #pragma once
3 #include "vde/brep/brep.h"
4 #include <string>
5 #include <vector>
6 #include <optional>
7 
8 namespace vde::foundation {
9 
17 struct GltfOptions {
19  bool binary = true;
20 
22  bool include_normals = true;
23 
25  bool include_colors = false;
26 
28  std::vector<float> vertex_colors;
29 };
30 
56 bool write_gltf(const std::string& filepath, const mesh::HalfedgeMesh& mesh,
57  const GltfOptions& options = GltfOptions{});
58 
80 bool write_brep_gltf(const std::string& filepath, const brep::BrepModel& model,
81  int tessellation_res = 32);
82 
83 } // namespace vde::foundation
边界表示(B-Rep)核心数据结构
B-Rep 模型
Definition: brep.h:177
半边数据结构三角网格
Definition: halfedge_mesh.h:54
bool write_brep_gltf(const std::string &filepath, const brep::BrepModel &model, int tessellation_res=32)
导出 B-Rep 模型为 GLB 格式(通过面片化)
bool write_gltf(const std::string &filepath, const mesh::HalfedgeMesh &mesh, const GltfOptions &options=GltfOptions{})
导出网格为 glTF 2.0 / GLB 格式
自适应双精度谓词后端(默认)
Definition: error_codes.h:4
glTF 2.0 导出选项
Definition: io_gltf.h:17
std::vector< float > vertex_colors
逐顶点 RGB 颜色数据(仅当 include_colors = true 时使用)
Definition: io_gltf.h:28
bool include_colors
是否导出逐顶点颜色
Definition: io_gltf.h:25
bool include_normals
是否计算和导出顶点法线
Definition: io_gltf.h:22
bool binary
是否以二进制 GLB 格式(单文件)输出;false 则输出 JSON + .bin 分离格式
Definition: io_gltf.h:19