資源簡介
自己實現的均勻&不均勻網格法。使用bunny數據進行了測試。歡迎交流指正。

代碼片段和文件信息
function?b?=?ascread(filename)??????%read?my?file
format?long;
fi?=?fopen(filename‘r‘);???????%openfile??‘r‘讀出參數
if?fi?0
??error(sprintf(‘File?%s?not?found‘?filename))
end
templine?=?1;?%
a?=?sscanf(fgetl(fi)?‘%d‘);%%fgetl從已經打開的文件中讀取一行,并且丟掉末尾的換行符。
templine?=?templine?+1;
if?length(a)==1
????points=a(1);
end
pointlist?=?zeros(3points);
for?vnum?=?1?:?points
??coord?=?sscanf(fgetl(fi)?‘%e?%e?%e‘);
??if?length(coord)?~=?3
????errmsg?=?sprintf(‘Each?vertex?line?must?contain?three?coordinates?(error?on?line?%d)‘?templine);
????error(errmsg);
??end
??templine?=?templine?+1;
??pointlist(:vnum)?=?coord;
end
b?=?cell({points;pointlist});
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-04-04?14:31??點云精簡_均勻&不均勻網格法\
?????文件?????????704??2015-12-23?13:38??點云精簡_均勻&不均勻網格法\ascread.m
?????文件?????1182978??2010-10-14?20:28??點云精簡_均勻&不均勻網格法\bun000.asc
?????文件????????1882??2018-04-04?14:29??點云精簡_均勻&不均勻網格法\evenly_grid.m
?????文件????????1194??2018-04-03?18:57??點云精簡_均勻&不均勻網格法\norcur.m
?????文件????????4358??2018-04-04?14:30??點云精簡_均勻&不均勻網格法\uneven_grid.m
評論
共有 條評論