Home > matGeom > meshes3d > meshBoundaryVertexIndices.m

meshBoundaryVertexIndices

PURPOSE ^

MESHBOUNDARYVERTEXINDICES Indices of boundary vertices of a mesh.

SYNOPSIS ^

function inds = meshBoundaryVertexIndices(varargin)

DESCRIPTION ^

MESHBOUNDARYVERTEXINDICES Indices of boundary vertices of a mesh.

   INDS = meshBoundaryVertexIndices(V, F)
   INDS = meshBoundaryVertexIndices(V, E, F)

   Example
     % create centered icosahedron
     [v, f] = createIcosahedron;
     v(:,3) = v(:,3) - mean(v(:,3));
     % convert to simili-sphere
     [v2, f2] = subdivideMesh(v, f, 3);
     v3 = normalizeVector3d(v2);
     % clip with plane
     plane = createPlane([0 0 0], [-1 -2 3]);
     [vc, fc] = clipMeshVertices(v3, f2, plane, 'shape', 'plane');
     figure; drawMesh(vc, fc); axis equal; view(3);
     % draw boundary vertices
     inds = meshBoundaryVertexIndices(vc, fc);
     hold on; drawPoint3d(vc(inds,:), 'k*');

   See also
     meshes3d, meshBoundary, meshBoundaryEdgeIndices, meshEdgeFaces

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function inds = meshBoundaryVertexIndices(varargin)
0002 %MESHBOUNDARYVERTEXINDICES Indices of boundary vertices of a mesh.
0003 %
0004 %   INDS = meshBoundaryVertexIndices(V, F)
0005 %   INDS = meshBoundaryVertexIndices(V, E, F)
0006 %
0007 %   Example
0008 %     % create centered icosahedron
0009 %     [v, f] = createIcosahedron;
0010 %     v(:,3) = v(:,3) - mean(v(:,3));
0011 %     % convert to simili-sphere
0012 %     [v2, f2] = subdivideMesh(v, f, 3);
0013 %     v3 = normalizeVector3d(v2);
0014 %     % clip with plane
0015 %     plane = createPlane([0 0 0], [-1 -2 3]);
0016 %     [vc, fc] = clipMeshVertices(v3, f2, plane, 'shape', 'plane');
0017 %     figure; drawMesh(vc, fc); axis equal; view(3);
0018 %     % draw boundary vertices
0019 %     inds = meshBoundaryVertexIndices(vc, fc);
0020 %     hold on; drawPoint3d(vc(inds,:), 'k*');
0021 %
0022 %   See also
0023 %     meshes3d, meshBoundary, meshBoundaryEdgeIndices, meshEdgeFaces
0024 
0025 % ------
0026 % Author: David Legland
0027 % E-mail: david.legland@inrae.fr
0028 % Created: 2019-05-01, using Matlab 8.6.0.267246 (R2015b)
0029 % Copyright 2019-2024 INRA - Cepia Software Platform
0030 
0031 [vertices, faces] = parseMeshData(varargin{:});
0032 
0033 BE = meshBoundaryEdges(vertices, faces);
0034 
0035 inds = unique(BE(:));

Generated on Thu 21-Nov-2024 11:30:22 by m2html © 2003-2022