VLELvertexfusion

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Auxiliary function
Introduced first in SolidGeometry 1.0, Creation date: 2012-07-29, Last change: 2025-09-14

merges the vertex list to a grid of a defined resolution

Description

Similar to VLFLvertexfusion, but uses a grid instead of a comparision.
Need to compare speed with a huge dataset

Example Illustration

 missing image of VLELvertexfusion(VL,EL,delta)

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

Output Results

Algorithm Steps

  1. Determine the initial number of vertices, n0, from the size of the vertex list VL.
  2. 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.
  3. 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.
  4. 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.
  5. Update the edge list EL using the index vector C to reflect the changes in the vertex list.
  6. 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.
  7. 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