No BSD License  

Highlights from
Fix to SHRINKFACES

Be the first to rate this file! 0 Downloads (last 30 days) File Size: 5.52 KB File ID: #11720

Fix to SHRINKFACES

by Ofek Shilon

 

18 Jul 2006 (Updated 18 Jul 2006)

A fix to shrinkfaces that behaves as documented also for patches not formed with faces/vertices prop

| Watch this File

File Information
Description

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

MATLAB release MATLAB 7.2 (R2006a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
data exploration Ofek Shilon 22 Oct 2008 08:32:41
shrinkfaces Ofek Shilon 22 Oct 2008 08:32:41
patch Ofek Shilon 22 Oct 2008 08:32:41
edge Ofek Shilon 22 Oct 2008 08:32:41
faces Ofek Shilon 22 Oct 2008 08:32:41

Contact us at files@mathworks.com