91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 3KB
    文件類型: .m
    金幣: 1
    下載: 0 次
    發(fā)布日期: 2021-06-03
  • 語言: Matlab
  • 標簽: ply??3D??matlab??

資源簡介

matlab 讀取三維文檔,.ply格式。 包括點、三角面和顏色。

資源截圖

代碼片段和文件信息

function?[triMesh?h]?=?myPLYread(FILENAME?FLAG)

%?input
%?FILENAME:?file?name?of?.ply
%?FLAG:?0?-?default:?no?drawing
%???????1?or?else:?
%?
%?output
%???????triMesh:?a?struct?that?is?similar?with?class?ptCloud?
%???????h:?handle?of?trisurf?(patch)
%
%?author/copyright?Matthew
%?date:?2015-10-05

%%?input?checking?and?initialize?variables
if?nargin?==?0
????error(‘Error!?Please?input?the?file?name.‘);
elseif?nargin?==?1
????FLAG?=?0;
end

nFace?=?[];
nHeader?=?[];?%?number?of?head?lines

%?struct?triMesh?similar?with?ptCloud
triMesh.Location?=?[];
triMesh.Color?=?[];
triMesh.Normal?=?[];
triMesh.Intensity?=?[];
triMesh.Face?=?[];
triMesh.cntVetext?=?[];
triMesh.cntFace?=?[];

%%?import?vertex?and?colors?(texture)
ptCloud?=?pcread(FILENAME);?%?pcread?can?import?vertex?and?colors
triMesh.Location?=?ptCloud.Location;
triMesh.Color?=?ptCloud.Color;
triMesh.Normal?=?ptCloud.Normal;
triMesh.Intensity?=?ptCloud.Intensity;
triMesh.cntVetext?=?ptCloud.Count;

clear?ptCloud;
%%?import?faces
fid?=?fopen(FILENAME‘rt‘);

for?i?=?1:20?
????tline?=?fgetl(fid);
????k1?=?strfind(tline?‘element?face‘);
????k2?=?strfind(tline?‘end_header‘);

????%?get?the?number?of?faces
????if?k1?==1
????????m=?length(tline);
????????nFace?=?str2num(tline(

評論

共有 條評論