如何在CGAL中加载Coff Mesh
How to load COFF mesh in cgal?
我想使用cgal :: read_off((加载coff文件(带有颜色的网格(。下一个尝试将这些信息组合到网格变量中(类似于polygon_soup_to_polygon_mesh函数,但不确定,因为此命令也不支持颜色信息(。您知道如何读取一个库存文件并将其合并为包含颜色信息的网格?
bool
read_OFF( std::istream& in,
std::vector< Point_3 >& points,
std::vector< Polygon_3 >& polygons,
std::vector<Color_rgb>& fcolors,
std::vector<Color_rgb>& vcolors,
bool /* verbose */ = false)
,然后
这是我要加载的库存文件的示例:
COFF
12 12 0
-0.4 -4.898587e-17 0.85 158 138 122 255
-0.4 -4.898587e-17 -0.9 255 0 122 255
0.4 4.898587e-17 -0.9 0 255 122 255
0.4 4.898587e-17 0.85 158 138 122 255
-0.4 -1.2 0.85 158 0 255 255
-0.4 -1.2 -0.9 158 138 122 255
0.4 -1.2 -0.9 158 138 122 255
0.4 -1.2 0.85 158 138 122 255
-0.4 -1.2 0.85 158 138 122 255
-0.4 -1.2 -0.9 100 255 0 255
0.4 -1.2 -0.9 222 0 122 255
0.4 -1.2 0.85 222 0 122 255
3 3 1 0
3 3 2 1
3 1 4 0
3 5 4 1
3 2 5 1
3 6 5 2
3 7 2 3
3 7 6 2
3 4 3 0
3 4 7 3
3 9 11 8
3 10 11 9
您可以使用Surface_mesh数据结构,它具有支持COFF文件的read_off((fuction,该文件由操作员>>((调用。 因此,Juste定义了surface_mesh(point_3(,我们称其为 sm
,coft file的iStream,我们称其为 is
,然后呼叫
is>>sm;
应该用网格和正确的颜色填充您的Surface_mesh。在您的示例中,颜色将为每个顶点。
相关文章:
- std::原子加载和存储都需要吗
- 如何加载(或映射)文件部分的最大大小,但适合在Windows上的RAM
- C++ 雷神库 - 使用资源加载器类时出现问题(不命名类型)
- 为什么加载SDF会导致Mobilizer创建闭环错误
- C++atioglxx.pdb未加载错误glBufferData OpenGL
- 如何使用tinyxml2从XML加载父实体和子实体
- 如何在C++中使用pybind11加载一个pickle python列表
- 系统.将数组移交给c#中动态加载的c++DLL时发生AccessViolationException
- 当我尝试加载内核模块时,如何修复C++中的这个 malloc() 错误?
- 树莓上的 Libtorch 无法加载 pt 文件,但在 ubuntu 上工作
- Python ctypes:不会按预期加载 dll
- 为什么会出现 gettnig 运行时错误:加载类型为"_Bit_type"(stl_bvector.h) 的空指针?
- 我的程序有一个保存配置文件的GUI,如何双击此配置文件以直接加载带有配置数据的GUI?
- 保存/加载大量短数组到二进制文件
- 使用 SDL2 和SDL_image C++加载图像
- 无法使用加载库卸载注入的 dll (C++)
- 是否有原子加载非原子值的函数?
- 将 bmp 文件加载到 TSpeedButton 中
- 如何使用Qt 3D库加载和显示搅拌机.obj源文件场景
- 如何在CGAL中加载Coff Mesh