ViewDesignEngine
3.1.0
高性能 CAD 计算几何引擎
io_gltf.h
浏览该文件的文档.
1
#pragma once
2
#include "
vde/mesh/halfedge_mesh.h
"
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
brep.h
边界表示(B-Rep)核心数据结构
vde::brep::BrepModel
B-Rep 模型
Definition:
brep.h:177
vde::mesh::HalfedgeMesh
半边数据结构三角网格
Definition:
halfedge_mesh.h:54
vde::foundation::write_brep_gltf
bool write_brep_gltf(const std::string &filepath, const brep::BrepModel &model, int tessellation_res=32)
导出 B-Rep 模型为 GLB 格式(通过面片化)
vde::foundation::write_gltf
bool write_gltf(const std::string &filepath, const mesh::HalfedgeMesh &mesh, const GltfOptions &options=GltfOptions{})
导出网格为 glTF 2.0 / GLB 格式
halfedge_mesh.h
vde::foundation
自适应双精度谓词后端(默认)
Definition:
error_codes.h:4
vde::foundation::GltfOptions
glTF 2.0 导出选项
Definition:
io_gltf.h:17
vde::foundation::GltfOptions::vertex_colors
std::vector< float > vertex_colors
逐顶点 RGB 颜色数据(仅当 include_colors = true 时使用)
Definition:
io_gltf.h:28
vde::foundation::GltfOptions::include_colors
bool include_colors
是否导出逐顶点颜色
Definition:
io_gltf.h:25
vde::foundation::GltfOptions::include_normals
bool include_normals
是否计算和导出顶点法线
Definition:
io_gltf.h:22
vde::foundation::GltfOptions::binary
bool binary
是否以二进制 GLB 格式(单文件)输出;false 则输出 JSON + .bin 分离格式
Definition:
io_gltf.h:19
include
vde
foundation
io_gltf.h
生成于 2026年 七月 24日 星期五 11:21:23 , 为 ViewDesignEngine使用
1.9.1