格式解析:
- ply
- format ascii 1.0 { ascii/binary, format version number }
- comment made by Greg Turk { comments keyword specified, like all lines }
- comment this file is a cube
- element vertex 8 { define "vertex" element, 8 of them in file }
- property float x { vertex contains float "x" coordinate }
- property float y { y coordinate is also a vertex property }
- property float z { z coordinate, too }
- element face 6 { there are 6 "face" elements in the file }
- property list uchar int vertex_index { "vertex_indices" is a list of ints }
- end_header { delimits the end of the header }
- 0 0 0 { start of vertex list }
- 0 0 1
- 0 1 1
- 0 1 0
- 1 0 0
- 1 0 1
- 1 1 1
- 1 1 0
- 4 0 1 2 3 { start of face list }
- 4 7 6 5 4
- 4 0 4 5 1
- 4 1 5 6 2
- 4 2 6 7 3
- 4 3 7 4 0
复制代码 直接上代码:
- read_object_model_3d ('C:/Users/Criss/Desktop/1-42 NO1.ply', 'mm', [], [], ObjectModel3D, Status)
- *获取顶点数目
- get_object_model_3d_params (ObjectModel3D, 'num_points', NumPoints)
- *获取每个坐标系数据
- get_object_model_3d_params (ObjectModel3D, 'point_coord_x', CoordX)
- get_object_model_3d_params (ObjectModel3D, 'point_coord_y', CoordY)
- get_object_model_3d_params (ObjectModel3D, 'point_coord_z', CoordZ)
- write_tuple (CoordX, 'CoordX.tup')
- write_tuple (CoordY, 'CoordY.tup')
- write_tuple (CoordZ, 'CoordZ.tup')
- *模拟图像显示交互
- visualize_object_model_3d (3600, ObjectModel3D, [], [], [], [], [], [], [], PoseOut)
复制代码 文件下载:
链接:https://pan.baidu.com/s/1n8gJSpXE3DAP9PhkYphu2A
提取码:8jvj
|