fi=FLremdoublevertex(FL)
FL : | Facet list |
fi : | removal facet index |
FLremdoublevertex([1 2 3;3 2 1;2 1 2; 4 2 4])
This function, FLremdoublevertex
, is designed to identify degenerate triangles within a facet list (FL). A degenerate triangle is one where two or more vertices are the same, such as [1 1 2] or [1 2 1].
true
means the corresponding facet is degenerate.The function works by evaluating each row of the input matrix FL
to check for degenerate triangles. It does this by comparing the vertex indices within each row:
FL(:,1)==FL(:,2)
: Checks if the first and second vertices are the same.FL(:,1)==FL(:,3)
: Checks if the first and third vertices are the same.FL(:,2)==FL(:,3)
: Checks if the second and third vertices are the same.The logical OR operator (|
) is used to combine these conditions, resulting in a logical array fi
where each element is true
if any of the conditions are met for the corresponding row, indicating a degenerate triangle.
Consider the following example:
FLremdoublevertex([1 2 3; 3 2 1; 2 1 2; 4 2 4])
In this example, the function will return a logical array indicating which rows contain degenerate triangles. The third row [2 1 2] and the fourth row [4 2 4] are degenerate, so the output will be:
[false; false; true; true]
Algorithm explaination created using ChatGPT on 2025-08-18 22:41. (Please note: No guarantee for the correctness of this explanation)