Fix to SHRINKFACES

버전 1.0.0.0 (2.09 KB) 작성자: Ofek Shilon
A fix to shrinkfaces that behaves as documented also for patches not formed with faces/vertices prop
다운로드 수: 1.5K
업데이트 날짜: 2006/7/18

라이선스 없음

The shipped shrinkfaces m-file fails (sometime) when operated through the syntax :
>> shrinkfaces(PatchHandle, ShrinkFactor)

It fails exactly when the operated patch was formed in a direct 'patch(x,y,z,c' manner, and not via 'patch('vertices',..., 'faces',..)'. The reason is that a patch formed in the former manner has FaceVertexCdata with size numVerts-by-3 (or by 1), and after the verts duplication performed by shrinkfaces it is irrelevant, and shrinkfaces fails to update it. This version does.
Please let me know of any bugs/further requests: ofek@REMOVETHISsimbionix.com .

Example:

[x,y,z,v] = flow;
[x,y,z,v] = reducevolume(x,y,z,v,2);
fv = isosurface(x,y,z,v,-3);

p=trisurf(fv.faces,fv.vertices(:,1),fv.vertices(:,2),fv.vertices(:,3))
shrinkfaces(p,0.6) ; % fails - does not behave as documented.

delete(gcf)
p=trisurf(fv.faces,fv.vertices(:,1),fv.vertices(:,2),fv.vertices(:,3))
myshrinkfaces(p,0.6) ; % succeeds

인용 양식

Ofek Shilon (2024). Fix to SHRINKFACES (https://www.mathworks.com/matlabcentral/fileexchange/11720-fix-to-shrinkfaces), MATLAB Central File Exchange. 검색됨 .

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

Community Treasure Hunt

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

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