VLdownsample

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - VL/Vertices/PC/Clouds
Introduced first in SolidGeometry 4.3, Creation date: 2018-10-08, Last change: 2025-09-14

returns a downsampled vertex list



See Also:

Example Illustration

 missing image of VLdownsample(VL,gs,ongrid)

Syntax

[NVL,a,b]=VLdownsample(VL,[gs,ongrid])

Input Parameter

VL: Vertex list
gs: grid size; default is 1 percent (100x100x100) = 10000
ongrid: 'grid','mean','stable','first','last'

Output Parameter

NVL: New vertex list
a: selection index of VL
b: mapping index of VL

Examples


loadweb IntelRealsense.mat
VLdownsample(VL_D415a); NVL=ans; whos('VL_D415a'), whos ('NVL')




Copyright 2018-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, VLdownsample, is designed to downsample a vertex list (VL) based on a specified grid size and method of downsampling. It is part of the SolidGeometry library.

Input Parameters

Output Results

Algorithm Steps

  1. Calculate the bounding box size of the vertex list using the function sofBB(VL).
  2. Set the grid size (gs) to 1% of the bounding box size by default. If a grid size is provided as an argument, use that instead.
  3. Set the ongrid method to 'stable' by default. If a method is provided as an argument, use that instead.
  4. Round the vertex list (VL) to the nearest grid size using the function rounddiv(VL, gs).
  5. Use the unique function to find unique rows in the rounded vertex list, returning the new vertex list (NVL), and indices a and b.
  6. Check the ongrid method:
  7. If no output arguments are specified, plot the original and downsampled vertex lists using SGfigure and VLplot functions.
Algorithm explaination created using ChatGPT on 2025-08-19 01:14. (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