如何使用Meshlab在.ply文件中绘制线条?

问题描述 投票:4回答:1

例如,我想从所有点云中选择两个点,并在它们之间画一条线。我正在使用Meshlab处理.ply文件,但我不知道该如何完成。我可以使用Meshlab或其他方式执行此操作吗?

3d mesh 3d-reconstruction meshlab ply-file-format
1个回答
0
投票

。ply文件中找到的最惯常元素是vertexface,但是.ply file format也允许使用edge定义网段的定义,而这些细分是Meshlab支持的。这是具有两个顶点和一个边缘元素的.ply文件的最小示例

ply format ascii 1.0 comment object: A single line element vertex 2 property float x property float y property float z element edge 1 property int vertex1 property int vertex2 end_header 0 0 0 0 0 1 0 1

这是一个更复杂的示例,每个顶点的颜色和一个立方体的角处有4条线。

ply format ascii 1.0 comment object: 4 edges with color per vertex element vertex 8 property float x property float y property float z property uchar red property uchar green property uchar blue element edge 4 property int vertex1 property int vertex2 end_header 0 0 0 255 0 0 0 0 1 255 0 0 0 1 1 255 0 0 0 1 0 255 0 0 1 0 0 0 0 255 1 0 1 0 0 255 1 1 1 0 0 255 1 1 0 0 0 255 0 4 1 5 2 6 3 7

这是网格实验室如何对上一个示例进行栅格化

Output of sample 2

正如我所说,meshlab仅部分支持edge元素,因此存在一些问题:

    Meshlab将加载带有边缘元素的.ply文件,但随后不会保存为ply文件格式。它只会将顶点和面导出到文件。
  • Meshlab在用edgeface元素表示文件时遇到问题。仅当处于单独的图层中时,才能正确绘制它们。 (如下图所示)
  • Edges and faces are show only in separate layers
© www.soinside.com 2019 - 2024. All rights reserved.