(一)PLY 文件格式

PLY Format

PLY or Stanford Polygon format defines a flexible and systematic scheme for storing graphical objects that are described as a collection of polygons. A ".PLY" file is composed of 3 main mandatory sections plus optional ones thereafter. The first section is the header, then comes the data in either ASCII or binary.

Header

The header is a collection of carriage-return terminated line with at least the following:

  • The first line must contain the lowercase directive: ply
    This indicates that the file is intended to be read as a PLY file.
  • The next line must be: format followed by either asciibinary_little_endian or binary_big_endian and a version number.
    This describes which format was used to store the information after the header.
  • The next lines start off with a directive followed be attributes, these can be:
    • comment followed by whatever text the author decided to use. This is ignored for reading
    • element followed by a label and a number. The labels parsed are vertex and face, usually vertices are described before faces. The number corresponds to the number of entries in this file.
    • property followed by a type and a label. An exception is the list type which is followed by 2 types, the first describing its length type and the second being the type stored in the list, and a label. These properties are tied to the element declared above them:
      Types can be:
      char or int88-bit integer1
      uchar or uint88-bit unsigned integer1
      short or int1616-bit integer2
      ushort or uint1616-bit unsigned integer2
      int or int3232-bit integer4
      uint or uint3232-bit unsigned integer4
      float or float32single-precision floating number4
      double or float64double-precision floating number8
  • The last line must contain the lowercase directive: endheader

ASCII data

Both vertex and face blocks are as they were described in the header with each property separated by a blank space and each line representing an element. The following example illustrates this:

ply
format ascii 1.0
element vertex 9
property float64 x
property float64 y
property float64 z
element face 8
property list uint32 int32 vertex_indices
end_header
-1.38639 1 1
-1.38639 1 1.11022e-016
-1.38639 2 1
-1.38639 2 1.66533e-016
-1.38639 -8.4892e-017 5.55112e-017
-1.38639 -1.46124e-016 1
-1.38639 -2.07357e-016 2
-1.38639 1 2
-1.38639 2 2
3 0 3 2
3 0 1 3
3 5 1 0
3 5 4 1
3 6 5 0
3 6 0 7
3 7 0 2
3 7 2 8

Binary data

The data blocks follow their description from the header so if the header is presented as such:

ply
format binary_little_endian 1.0
element vertex 9
property float64 x
property float64 y
property float64 z
element face 8
property list uint32 int32 vertex_indices
end_header
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值