作者: Kenny Chu
主页: https://kennyangel.github.io/
编辑: 20230703
上传: 20230703
摘要:
PLY文件的格式介绍。
PLY文件格式:PLY - Polygon File Format (paulbourke.net)
Python 库 plyfile 中关于PLY文件格式的描述:Wayback Machine (archive.org)
CSDN_Q81:“三角形网格”之“PLY文件”:https://blog.csdn.net/libing_zeng/article/details/61195502
CSDN_计算机视觉基石--PLY文件基础与读写:https://blog.csdn.net/u012348774/article/details/107948948
以下关键词格式注释在前一行
xply
# 文件格式format ascii 1.0# comment 为注释行comment author: Kenny Chu comment home page: https://kennyangel.github.io/
# 当前文件中单元的所有的顶点个数element vertex 134585 # 单元顶点数据表达形式,下三行分别为顶点 xyz 格式property float x property float y property float z
# 当前文件中单元的所有的边线个数element edge 2639490 # 单元边数据表达形式,下两行分别为顶点1和顶点2的IDproperty int vertex1_IDproperty int vertex2_ID
# 当前文件中单元面的总个数element face 1759660 # 单元面的数据表达形式,各个名词释义如下:# list:表示该行数据为一个列表# int: 表示该 list 的大小,如3、4、5# int: 表示该 list 中的元素类型为int# vertex_indices:表示顶点索引property list int int vertex_indices
# ply 头文件的结束标识end_header
# 顶点数据举例(xyz坐标)3170.67822 648.709595 -0.53169.36133 649.124634 -0.53169.36133 649.124634 0.03170.67822 648.709594 0.0...# 单元边数据举例(vertex1_ID, vertex2_ID)33099 32959 41094 33099 41094 52089 41094 22325 ...# 单元面数据举例(list int int vertex_indices)3 44533 44729 25772 3 44729 25772 37848 3 25772 37848 44533 ...
以下为PLY的简单测试文件,保存为Test.ply后,通过3D查看器或MeshLab打开。
xxxxxxxxxxplyformat ascii 1.0 comment made by Greg Turk comment this file is a cubeelement vertex 12 property float x property float y property float z element face 10 property list uchar int vertex_index end_header 0 0 0 0 0 10 1 10 1 01 0 01 0 11 1 11 1 01.1 1.1 02.1 1.1 01.1 2.1 01.1 1.1 14 0 1 2 3 4 7 6 5 44 0 4 5 14 1 5 6 24 2 6 7 34 3 7 4 03 8 9 103 8 9 113 8 10 113 9 10 11