Fix to SHRINKFACES

A fix to shrinkfaces that behaves as documented also for patches not formed with faces/vertices prop
1,5K descargas
Actualizado 18 jul 2006

Sin licencia

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

Citar como

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

Compatibilidad con la versión de MATLAB
Se creó con R2006a
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux
Categorías
Más información sobre Polygons en Help Center y MATLAB Answers.

Community Treasure Hunt

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

Start Hunting!
Versión Publicado Notas de la versión
1.0.0.0