PLmeancluster

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - PL/Point Lists
Introduced first in SolidGeometry 4.5, Creation date: 2019-03-08, Last change: 2025-09-14

converts a point list into a mean values point list

Description

clusters points of a list by a simple grid resolution. In contrast to simple using rounddiv, the mean value of the points that belong to the same grid point is calculated and replaces the original coordinates of the List
either us iconofCPL or CPLdisteuclidcontur before PLmeancluster

See Also: iconofCPL , rounddiv

Example Illustration

 missing image of PLmeancluster(PL,res)

Syntax

[PLM,ia,ib,PLR]=PLmeancluster(PL,[res])

Input Parameter

PL: point or verteex list [n x m]
res: resolution four rounding; default is 0.5 (will be changed in future)

Output Parameter

PLM: Point list with mean values
ia: index of short list in original list
ib: index of original list in short list
PLR: Point list with grid rounded points

Examples


PLmeancluster(rand(1000,2));
PLmeancluster(rand(1000,2),3);
[PLM,ia,ib]=PLmeancluster(rand(1000,3)); PLM(ia,:) % returns the shortened PL list
PLmeancluster(CPLaddauxpoints(CPLsample(29),.3),.3) $ Downsamplint to 0.3




Copyright 2019-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

Last html export of this page out of FM database by TL: 2025-09-21