Revision 2ce396a76821d352b608cbcadbb6c57de59620c3 authored by Alec Jacobson on 08 January 2020, 05:26:22 UTC, committed by Alec Jacobson on 08 January 2020, 05:26:22 UTC
1 parent 9d0a7c0
tricontour.m
function tricontour(V,F,w,speedup)
% TRICONTOUR Plot a filled contour defined on top of a triangle mesh returns
% function handle
%
% tricontour(V,F,w,speedup)
%
%
% Inputs:
% V list of vertex positions
% F list of face indices
% w scalar values defined on V
% speedup optional speed up by not eliminating vertices outside shape {false}
if(~exist('speedup','var'))
speedup = false;
end
[Xr,Yr,Wr] = triinterp(V,F,w,speedup);
contourf(Xr,Yr,Wr)
% Find all edges in mesh, note internal edges are repeated
E = sort([F(:,1) F(:,2); F(:,2) F(:,3); F(:,3) F(:,1)]')';
% determine uniqueness of edges
[u,m,n] = unique(E,'rows');
% determine counts for each unique edge
counts = accumarray(n(:), 1);
% extract edges that only occurred once
O = u(counts==1);
line(V([O(:);O(1)],1),V([O(:);O(1)],2),'Color','k','LineWidth',6)
end
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...