ViewDesignEngine  3.1.0
高性能 CAD 计算几何引擎
vde::foundation::ObjMeshData结构体 参考

OBJ 文件解析结果数据结构 更多...

#include <io_obj.h>

Public 成员函数

bool has_texcoords () const
 是否有纹理坐标数据 更多...
 

Public 属性

std::vector< Point3Dvertices
 顶点位置数组 更多...
 
std::vector< Point2Dtexcoords
 纹理坐标数组(可能为空) 更多...
 
std::vector< Vector3Dnormals
 顶点法线数组(可能为空) 更多...
 
std::vector< std::vector< int > > faces
 每个面的顶点索引列表(0-based) 更多...
 
std::vector< std::vector< int > > face_texcoords
 每个面的纹理坐标索引列表(0-based) 更多...
 
std::vector< std::vector< int > > face_normals
 每个面的法线索引列表(0-based) 更多...
 
std::vector< std::string > face_materials
 每个面对应的材质名称 更多...
 

详细描述

OBJ 文件解析结果数据结构

存储从 Wavefront OBJ 文件读取的完整几何数据, 包括顶点位置、纹理坐标、法线、面信息和材质分组。

内部索引均为 0-based,与文件中的 1-based 索引不同。

在文件 io_obj.h18 行定义.

成员函数说明

◆ has_texcoords()

bool vde::foundation::ObjMeshData::has_texcoords ( ) const
inline

是否有纹理坐标数据

在文件 io_obj.h57 行定义.

引用了 texcoords.

类成员变量说明

◆ face_materials

std::vector<std::string> vde::foundation::ObjMeshData::face_materials

每个面对应的材质名称

face_materials[i] 给出第 i 个面使用的材质名。 材质名来源于 usemtl 指令,在定义后所有后续面使用该材质。

在文件 io_obj.h54 行定义.

◆ face_normals

std::vector<std::vector<int> > vde::foundation::ObjMeshData::face_normals

每个面的法线索引列表(0-based)

与 faces 数组长度相同;若无法线数据则为空。

在文件 io_obj.h46 行定义.

◆ face_texcoords

std::vector<std::vector<int> > vde::foundation::ObjMeshData::face_texcoords

每个面的纹理坐标索引列表(0-based)

与 faces 数组长度相同;若无纹理数据则为空。

在文件 io_obj.h39 行定义.

◆ faces

std::vector<std::vector<int> > vde::foundation::ObjMeshData::faces

每个面的顶点索引列表(0-based)

无论文件中面的格式如何(纯顶点、"v/vt"、"v/vt/vn"), 此字段始终被填充。faces[i] 存储第 i 个面的所有顶点索引。

在文件 io_obj.h32 行定义.

◆ normals

std::vector<Vector3D> vde::foundation::ObjMeshData::normals

顶点法线数组(可能为空)

在文件 io_obj.h24 行定义.

◆ texcoords

std::vector<Point2D> vde::foundation::ObjMeshData::texcoords

纹理坐标数组(可能为空)

在文件 io_obj.h22 行定义.

被这些函数引用 has_texcoords().

◆ vertices

std::vector<Point3D> vde::foundation::ObjMeshData::vertices

顶点位置数组

在文件 io_obj.h20 行定义.


该结构体的文档由以下文件生成: