PIL=usedinEL(NEL)
NEL : | Any kind of list of integers, such as EL, FL |
PIL : | Entry index list [Entry number] |
CPLoftext('test'); CPL=ans; % Create contours
CPL=rounddiv(CPL,3); % Grid will create non manifold edges
SGfigure; CPLplot(CPL); [PL,EL]=PLELofCPL(CPL);
[PL,EL]=VLELshort(PL,EL); % removed doubled used points
EL=unique(EL,'rows','stable'); % remove doubled edges
EL=EL(EL(:,1)~=EL(:,2),:) % remove point type edges
usedinEL(EL)
TR=delaunayTriangulation(PL,EL);
SGfigure; VLFLplot(TR.Points,TR.ConnectivityList(isInterior(TR),:))
B.VL=VLaddz(TR.Points); B.FL=TR.ConnectivityList(isInterior(TR),:)
B=SGshort(B); % remove unused points
SGremsurfedgepoints(B)
This function, usedinEL
, is designed to process a list of integers, typically representing edges or faces in a geometric model, and return a list of unique numbers along with their frequency of occurrence in the list.
NEL
using the unique
function and store them in a
.b
as a copy of a
.a
:NEL
using sum(sum(NEL==a(i)))
and store the count in the corresponding position in b
.a
and b
into a two-column matrix PIL
, where the first column contains the unique elements and the second column contains their counts.PIL
in descending order based on the count (second column) and then by the unique number (first column) using sortrows(PIL,[-2 1])
.The function is used in a sequence of operations to process geometric data, such as creating contours, removing duplicate points, and plotting. It helps in identifying and managing non-manifold or corrupted edges in a geometric model.
Algorithm explaination created using ChatGPT on 2025-08-19 06:47. (Please note: No guarantee for the correctness of this explanation)