概述
MATLAB
对
ply
文件格式的读取和显示
首先是这个
ply_read.m
文件
[plain] view plain copy print?
在
CODE
上查看代码片派生到我的代码片
function [ Elements, varargout ] = PL
Y_READ ( Path, Str )
%*****************************************************************************
80
%
%% PL
Y_READ reads a PLY 3D data file.
%
%
[DATA,COMMENTS] = PL
Y_READ(FILENAME) reads a version 1.0 PL
Y file
%
FILENAME and returns a structure DATA.
The fields in this structure
%
are defined by the PL
Y header; each element type is a field and each
%
element property is a subfield.
If the file contains any comments,
%
they are returned in a cell string array COMMENTS.
%
%
[TRI,PTS] = PL
Y_READ(FILENAME,'tri') or
%
[TRI,PTS,DATA,COMMENTS] = PL
Y_READ(FILENAME,'tri') converts vertex
%
and face data into triangular connectivity and vertex arrays.
The
%
mesh can then be displayed using the TRISURF command.
%
%
Note: This function is slow for large mesh files (+50K faces),
%
especially when reading data with list type properties.
%
%
Example:
%
[Tri,Pts] = PL
Y_READ('cow.ply','tri');
%
[Tri,Pts] = PL
Y_READ('bunny.ply','tri');
%
trisurf(Tri,Pts(:,1),Pts(:,2),Pts(:,3));
%
colormap(gray); axis equal;
%
%
Discussion:
%
%
The original version of this program had a mistake that meant it
%
did not properly triangulate files whose faces were not already triangular.
%
This has been corrected (JVB, 25 February 2007).
%
%
Glenn Ramsey pointed out and corrected a problem that occurred
%
with an uninitialized value of Type2, 27 August 2012.
%
%
Licensing:
%
%
This code is distributed under the GNU LGPL license.
%
最后
以上就是小巧唇彩为你收集整理的matlab 读取pts_MATLAB对ply文件格式的读取和显示的全部内容,希望文章能够帮你解决matlab 读取pts_MATLAB对ply文件格式的读取和显示所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复