Syntax
[VL,j]=VLcat(V1,V2)
Input Parameter
V1 : | | Vertex List 1 |
V2 : | | Vertex List 2 |
Output Parameter
VL : | | Combined Vertex list |
j : | | Number of added vertices |
Copyright 2010-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 algorithm is designed to concatenate two vertex lists, V1 and V2, into a single combined vertex list, VL. It also provides indices of the last added vertices.
Input Parameters
- V1: The first vertex list, which is a matrix where each row represents a vertex.
- V2: The second vertex list, also a matrix with vertices as rows.
Output Results
- VL: The combined vertex list after adding vertices from V2 to V1.
- j: The index of the last added vertex in the combined list.
- j1, j2, j3: Indices of the first, second, and third added vertices, respectively.
Algorithm Steps
- Initialize indices j, j1, j2, and j3 to zero.
- Determine the number of vertices in V2, denoted as n.
- If V1 is empty, set VL to V2 and update indices j, j1, j2, and j3 based on the number of vertices in V2. Then, return the results.
- Iterate over each vertex in V2:
- Use the function VLindex to check if the current vertex from V2 is already in V1.
- If the vertex is not found (j == 0), add it to V1 at the next available position and update j.
- Update j1, j2, or j3 based on the current iteration index (i).
- After processing all vertices, set VL to the updated V1.
The algorithm could be significantly improved by using the unique command to handle duplicate vertices more efficiently.
Algorithm explaination created using ChatGPT on 2025-08-18 22:44. (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