subtri(F,V,n,unique​Opt)

버전 1.3.0.0 (7.25 KB) 작성자: Kevin Moerman
Sub-triangulates patch format data. Can be used to increase the density of triangulated data
다운로드 수: 959
업데이트 날짜: 2015/4/28

라이선스 보기

[Fs,Vs]=subtri(F,V,n,uniqueOpt);
Sub-triangulates the triangles defined by the patch format data F (faces) and V (vertices). Can be used to increase the density of triangulated data.

Sub-triangulates the triangles defined by the patch format data F (faces) and V (vertices). Creates n addition points on the edges of the initial triangles, thus it creates (n+1).^2 triangles per original triangle. Two methods are implemented one which iteratively splits edges and can thus only be used if log2(n+1) is a positive integer. This method guarantees that all points are unique. If log2(n+1) is not a positive integer points are seeded on all edges initially creating non-unique points. However if uniqueOpt is 1 (default if not provided) these points are suppressed using the unique command (based on rounding of coordinates to 5th decimal place after edge length based scaling).

%% EXAMPLE
[X,Y] = meshgrid(linspace(-10,10,15));
Z = sinc(sqrt((X/pi).^2+(Y/pi).^2));
F = delaunay(X,Y); V=[X(:) Y(:) Z(:)]; C=mean(Z(F),2);

n=2;
[Fs,Vs]=subtri(F,V,n);
Vs(:,3)=sinc(sqrt((Vs(:,1)/pi).^2+(Vs(:,2)/pi).^2)); Z=Vs(:,3);Cs=mean(Z(Fs),2);

figure('units','normalized','Position',[0 0 1 1],'Color','w'); colordef('white');
subplot(1,2,1);patch('Faces',F,'Vertices',V,'FaceColor','flat','CData',C,'FaceAlpha',0.5,'EdgeColor','k','LineWidth',2); hold on;
axis tight; axis square; grid on; hold on; view(3); axis off;
title('Original','FontSize',20);
subplot(1,2,2);patch('Faces',Fs,'Vertices',Vs,'FaceColor','flat','CData',Cs,'FaceAlpha',0.5,'EdgeColor','k','LineWidth',0.5); hold on;
axis tight; axis square; grid on; hold on; view(3); axis off;
title(['n=',num2str(n)],'FontSize',20);

인용 양식

Kevin Moerman (2024). subtri(F,V,n,uniqueOpt) (https://www.mathworks.com/matlabcentral/fileexchange/28277-subtri-f-v-n-uniqueopt), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2015a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Delaunay Triangulation에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.3.0.0

Updated with splitting method (faster)

1.2.0.0

Fixed normal direction and reference to missing function

1.1.0.0

Fixed instability due to "unique" function. Removed dependency on linspacen function which I did not upload.

1.0.0.0