usedinEL

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Auxiliary function
Introduced first in SolidGeometry 4.2, Creation date: 2018-06-02, Last change: 2025-09-14

returns a list of unique numbers and the number of use in the list

Description

Auxiliary function for searching in non manifold or corrupted edge lists

See Also: graphofEL , ELplot

Example Illustration

 missing image of usedinEL(NEL)

Syntax

PIL=usedinEL(NEL)

Input Parameter

NEL: Any kind of list of integers, such as EL, FL

Output Parameter

PIL: Entry index list [Entry number]

Examples


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)




Copyright 2018-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Algorithm (Workflow)

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.

Input Parameters

Output Results

Algorithm Steps

  1. Identify unique elements in the input list NEL using the unique function and store them in a.
  2. Initialize b as a copy of a.
  3. Iterate over each unique element in a:
  4. Combine a and b into a two-column matrix PIL, where the first column contains the unique elements and the second column contains their counts.
  5. Sort PIL in descending order based on the count (second column) and then by the unique number (first column) using sortrows(PIL,[-2 1]).

Example Usage

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)

Last html export of this page out of FM database by TL: 2025-09-21