mesh_refine.m

来自「Matlab下的EEG处理程序库」· M 代码 · 共 57 行

M
57
字号
function [ FV ] = mesh_refine(FV,Nface)

% MESH_REFINE - creates smaller triangles from a triangle mesh
%
% [ FV ] = mesh_refine( FV, Nface )
%
% FV.vertices   - vertex matrix (Nx3)
% FV.faces      - face matrix (Mx3), indices into vertex matrix rows
%
% Nface         - subdivide faces into 4 or 6 faces,
%                 the default 4 provides an even subdivision
% 
% This function calls MESH_REFINE_TRI4 or MESH_REFINE_TRI6.  See
% these for more details.
% 


% This can be done until some minimal distance (D) of the mean 
% distance between vertices of all triangles is achieved.  If
% no D argument is given, the function refines the mesh once.
%

% $Revision: 1.2 $ $Date: 2003/03/02 03:20:44 $

% Licence:  GNU GPL, no implied or express warranties
% History:  08/2002, Darren.Weber@flinders.edu.au, created
%                    adapted this function as a wrapper to
%                    mesh_refine_tri4 & mesh_refine_tri6
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


if ~exist('FV','var'),
    error('MESH_REFINE: NO input FV struct');
elseif isempty(FV),
    error('MESH_REFINE: NO input FV struct');
end

if ~exist('Nface','var'),
    Nface = 4;
elseif isempty(Nface),
    Nface = 4;
end


switch Nface,
    
case 4,
    FV = mesh_refine_tri4(FV);
case 6,
    FV = mesh_refine_tri6(FV);
otherwise
    FV = mesh_refine_tri4(FV);
end


return
 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?