https://github.com/HTDerekLiu/SpecCoarsen_MATLAB
Raw File
Tip revision: 749b4bf2aa89143c0b50c9a2a50a6fbd6b115919 authored by HTDerekLiu on 12 September 2019, 16:56:12 UTC
update number of eVec in use
Tip revision: 749b4bf
normalizeUnitArea.m
function V = normalizeUnitArea(V,F)
% NORMALIZEUNITAREA normalizes a given mesh to have unit total surface area
%
% V = normalizeUnitArea(V,F)
%
% Inputs:
%   V |V| x 3 matrix of vertex positions
%   F |F| x 3 matrix of indices of triangle corners
% Outputs:
%   V a new matrix of vertex positions whose total area is 1

VA = vertexAreas(V,F);
totalArea = sum(VA);
V = V / sqrt(totalArea); % normalize shape to have unit area
back to top