Syntax
[VL,EL,n,dn]=VLELvertexfusion(VL,EL,[delta])
Input Parameter
VL : | | Vertex list |
EL : | | Edge list |
delta : | | Grid distance |
Output Parameter
VL : | | Shorten vertex list |
EL : | | Edge list |
n : | | number of vertices |
dn : | | number of reduced vertices |
Copyright 2012-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, VLELvertexfusion, is designed to merge vertices in a list to a grid of a defined resolution. It is part of the SG-Library and was created by Tim Lueth in 2012. The function takes in a vertex list (VL), an edge list (EL), and an optional grid distance (delta) to produce a shortened vertex list and an updated edge list.
Input Parameters
- VL: The vertex list, which is a matrix where each row represents a vertex in 3D space.
- EL: The edge list, which is a matrix where each row represents an edge connecting two vertices.
- delta: An optional parameter that defines the grid distance. If not provided, it defaults to 0.00000001 mm.
Output Results
- VL: The shortened vertex list after merging vertices that are within the grid distance.
- EL: The updated edge list reflecting the changes in the vertex list.
- n: The number of vertices in the shortened vertex list.
- dn: The number of vertices that were reduced.
Algorithm Steps
- Determine the initial number of vertices,
n0
, from the size of the vertex list VL
.
- Set the grid distance
delta
to a default value of 0.00000001 mm. If a third argument is provided, use it as the grid distance.
- Apply the
rounddiv
function to the vertex list VL
with the grid distance delta
. This function rounds the vertices to the nearest grid point defined by delta
.
- Use the
unique
function to remove duplicate vertices from the list. This function also returns an index vector C
that maps the original vertices to the new, unique vertices.
- Update the edge list
EL
using the index vector C
to reflect the changes in the vertex list.
- If the number of output arguments is two or more, calculate the new number of vertices
n
and the number of reduced vertices dn
as the difference between n0
and n
.
- If any vertices were removed, print a message indicating the number of vertices removed and the grid distance used.
Algorithm explaination created using ChatGPT on 2025-08-19 00:04. (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