Find Holes in Triangular Mesh

Finds and returns a cell array of holes in a triangular mesh
347 Downloads
Updated 12 Sep 2017

View License

function [holeCellArray,bounding_triangles,holeLengths] = findTriMeshHoles(faces,vertices)
% Finds holes in a triangular mesh
% Note: Does not work if a hole shares more than one vertex with other holes
% Input:
% faces = M x 3
% vertices = N x 3 (optional if you want the hole lengths)
% Output:
% holeCellArray = P x 1 cell array containing a list of holes, which are
% traced in consecutive order (list of scalar indices)
% bounding_triangles = Q x 3 list of faces that contain a bounding edge (does
% not contain triangles that only has a single bounding vertex)
% holeLengths = P x 1 vector containing the perimeter of each hole
Please let me know if you find any errors. Thanks!

Cite As

Audrey Cheong (2024). Find Holes in Triangular Mesh (https://www.mathworks.com/matlabcentral/fileexchange/62419-find-holes-in-triangular-mesh), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2015a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on General Physics in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0

Fix demo.m
Bug fix