Syntax
CL=ELremovedoubledconstraints(CL)
Input Parameter
Output Parameter
CL : | | Constraint edge list with no doubles |
Examples
ELremovedoubledconstraints([1 2; 1 2; 3 4;3 4; 4 3])
Copyright 2020-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, ELremovedoubledconstraints
, is designed to remove duplicate entries from a constraint edge list (CL). It is part of the SolidGeometry library and addresses a known issue with the delaunayTriangulation
function.
Input Parameters
- CL: A matrix representing a constraint edge list, where each row corresponds to an edge defined by two vertices.
Output
- CL: The modified constraint edge list with duplicate edges removed.
Algorithm Steps
- Use the
unique
function to remove duplicate rows from the constraint edge list. The 'rows' option ensures that entire rows are considered, and 'stable' maintains the original order of the list.
- Identify forward-backward duplicate edges using
ismember
. This function checks for rows in CL that are the reverse of other rows (e.g., [1 2] and [2 1]).
- Filter these duplicates by ensuring that only the edge with the smaller first vertex is retained. This is done by checking if the first vertex of the duplicate is greater than the second vertex.
- Convert the indices of the duplicates into a logical index array using
find2logical
, which is a custom function that creates a logical array of the same size as CL, marking duplicates as true.
- Remove the identified duplicates from CL using logical indexing, ensuring that only one representation of each edge remains.
Algorithm explaination created using ChatGPT on 2025-08-19 00:05. (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