https://github.com/gaolinorange/SDMNET_stamp
Tip revision: 5208f1210b77e3251dde3bdafc120a48dc69e833 authored by wutong on 27 March 2021, 07:58:47 UTC
Update ReconstructFromCodeMixIntegerReadingObjinAdvance.m
Update ReconstructFromCodeMixIntegerReadingObjinAdvance.m
Tip revision: 5208f12
patchslim.m
function [vnew, fnew]=patchslim(v, f)
% PATCHSLIM removes duplicate vertices in surface meshes.
%
% This function finds and removes duplicate vertices.
%
% USAGE: [v, f]=patchslim(v, f)
%
% Where v is the vertex list and f is the face list specifying vertex
% connectivity.
%
% v contains the vertices for all triangles [3*n x 3].
% f contains the vertex lists defining each triangle face [n x 3].
%
% This will reduce the size of typical v matrix by about a factor of 6.
%
% For more information see:
% http://www.esmonde-white.com/home/diversions/matlab-program-for-loading-stl-files
%
% Francis Esmonde-White, May 2010
if ~exist('v','var')
error('The vertex list (v) must be specified.');
end
if ~exist('f','var')
error('The vertex connectivity of the triangle faces (f) must be specified.');
end
[vnew, indexm, indexn] = unique(v, 'rows');
fnew = indexn(f);