selectNaN

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Auxiliary function
Introduced first in SolidGeometry 3.6, Creation date: 2017-03-11, Last change: 2025-09-14

connects subsets of closed polygons lines (2D/3D) wrt an index list



See Also: lengthNaN , replaceNaN , cellofNaN , separateNaN , uniqueNaN , unsortNaN

Example Illustration

 missing image of selectNaN(CPL,ci)

Syntax

CPLN=selectNaN(CPL,ci)

Input Parameter

CPL: CPL / CVL
ci: index list [

Output Parameter

CPLN: Subset of CPL or new ordered CPL

Examples

Select 3 CPL of CPLsample(14)
selectNaN(VLaddz(CPLsample(14),pi),[1,3,6])




Copyright 2017-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, selectNaN, is designed to select and reorder subsets of closed polygon lines (CPL) based on a given index list. It is part of the SolidGeometry library.

Input Parameters

Output

Algorithm Steps

  1. Check if the index list ci is empty. If it is, return an empty matrix for CPLN.
  2. If ci is a column vector, transpose it to a row vector.
  3. Initialize CPLN as a matrix of NaNs with the same size as CPL.
  4. If ci contains only one index, use the separateNaN function to extract the corresponding subset from CPL.
  5. If ci contains multiple indices, iterate over each index in ci:
  6. Trim CPLN to remove any trailing NaN rows.
  7. If no output argument is specified, plot the original and selected CPLs:
Algorithm explaination created using ChatGPT on 2025-08-19 01:34. (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