我有一个三角形网格 stl/wrl 文件,我想通过添加点来密集网格。例如,每个三角形可以分成4个较小的三角形。如何执行此网格插值?
我在meshlab中找不到这样的东西,而且由于我的形状很大,迭代所有三角形网格会花费太多时间......
找到(懒惰的)答案 - 在遍历整个卷时密集网格:
[tri,pts]; % tri is triples of indices from pts
triperms=[1 1; 1 2; 1 3; 2 2 ;2 3 ; 3 3];
newTri = [1 2 3;2 4 5;3 5 6;2 5 3];
triI = [];
ptsI=[];
for i=1:size(tri,1)
facetPts = pts(tri(i,:)',:);
newPts=squeeze(mean(reshape(facetPts(triperms,:),[6 2 3]),2));
indx = size(ptsI,1);
ptsI(indx+(1:6),:)=newPts;
triI(end+1:end+4,:)=indx+newTri;
end