centerVL

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Analytical Geometry
Introduced first in SolidGeometry 2.8, Creation date: 2016-02-14, Last change: 2025-09-14

returns the center and distance indices of a vertex list

Description

Auxiliary function to find nearest points to a cloud center

See Also: center3P , center4P , centerPL

Example Illustration

 missing image of centerVL(VL)

Syntax

[c,ci,d,n]=centerVL(VL)

Input Parameter

VL: Vertex list (nx3)

Output Parameter

c: center
ci: index list of nearest vertices
d: distance vector to center (nx3)
n: distance norm to center (nx1)

Examples

Show the center of a random list
centerVL (rand(100,3))
centerVL(VLtransR(VLaddz(PLcircle(2)),rot(0,pi/3,pi/3)))




Copyright 2016-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, centerVL, is designed to find the center and distance indices of a vertex list. It is an auxiliary function to find the nearest points to a cloud center.

Input Parameters

Output Results

Algorithm Steps

  1. Suppress specific warnings related to duplicate points in Delaunay triangulation.
  2. Create a Delaunay triangulation object TR3 from the vertex list VL.
  3. Attempt to compute the convex hull of the triangulation. If it fails, use all vertices.
  4. Calculate the center c as the mean of the vertices forming the convex hull.
  5. Compute the distance vector d and the distance norm n from each vertex to the center using the function VLnorm.
  6. Identify the indices ci of the vertices closest to the center by finding the minimum distance.
  7. If no output arguments are specified, plot the vertex list and the center using SGfigure and VLplot.
Algorithm explaination created using ChatGPT on 2025-08-19 01:16. (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