viVLFLnearestneighborVL

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Surfaces
Introduced first in SolidGeometry 4.9, Creation date: 2020-01-22, Last change: 2025-09-14

returns the vertex indices of the nearest neighbors of a Vertex list

Description

TR=triangulation(FLA,VLA); vi=nearestNeighbor(TR,VL);

See Also: FLofVLFLfi , FLofVLFLnearestneighborVL , FLofVLFLvi

Example Illustration

 missing image of viVLFLnearestneighborVL(VLA,FLA,VL)

Syntax

vi=viVLFLnearestneighborVL(VLA,FLA,VL)

Input Parameter

VLA: Vertex List of Solid
FLA: Facet List of Solid
VL: Vertex list to check

Output Parameter

vi: neares neighbor index to VLA

Examples


SG=SGbox; viVLFLnearestneighborVL(SG.VL,SG.FL,rand(1,3)*10)




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, viVLFLnearestneighborVL, is designed to find the nearest neighbor indices of a given vertex list relative to a solid's vertex list. It is part of the SG-Library and was introduced in SolidGeometry 4.9.

Input Parameters

Output Results

Algorithm Steps

  1. Create a triangulation object TR using the facet list FLA and vertex list VLA.
  2. Use the nearestNeighbor function to find the nearest neighbor indices vi for each vertex in VL relative to the triangulation TR.
  3. Extract unique rows from VL and store them in NL.
  4. Extract unique indices from vi and store them in ni.
  5. Create a matrix IVL by combining vi and VL.
  6. Extract unique rows from IVL.
  7. If no output is requested, visualize the results:

Example Usage

To use this function, you can call it with a solid's vertex and facet lists, and a random vertex list:

SG = SGbox;
viVLFLnearestneighborVL(SG.VL, SG.FL, rand(1,3) * 10);
Algorithm explaination created using ChatGPT on 2025-08-19 06: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