我想使用 CGAL::read_OFF() 加载一个 coff 文件(带颜色的网格)。下一次尝试将这些信息组合成一个网格变量(类似于 polygon_soup_to_polygon_mesh 函数,但不确定,因为这个命令也不支持颜色信息)。您知道如何读取 COFF 文件并将它们合并为包含颜色信息的网格吗?
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 文件的示例:
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