A simple m file for the triangle mesh subdivision using the Loop's scheme. The zip file includes four examples of subdivision.
Jesús P. Mena-Chalco (2020). Loop Subdivision (https://www.mathworks.com/matlabcentral/fileexchange/24942-loop-subdivision), MATLAB Central File Exchange. Retrieved .
it is very useful
Attempted to access edgeVertice(1,4,1); index out of bounds because size(edgeVertice)=[3,3,3].(line116)
After adding a few tricks, it takes only 0.861 seconds from 223 triangles to 228352 triangles (5x subdivisions).
Making use of the Matlab embedded data structure: TriRep could make this a lot faster. This function took 1357.56 seconds subdividing 122 triangles to 124928 triangles (5 times subdivision). I did it in 2.2 seconds with TriRep.
The boundary cases are considered.