woNaN

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

returns a row list without all rows that have a NaN in first row

Description

For the construction of planar or spacial contours the concept of NaN separated polygons was introduced in the mapping toolbox. Nevertheless when changing to triangulation representation (delaunaytriangulation or triangulation) those NaN are a problem. Either use VLFLselect in case that faces exist already or use woNaN to remove the NaN

See Also: PLofCPL , VLFLselect , VLELselect

Example Illustration

 missing image of woNaN(PL)

Syntax

PL=woNaN(PL)

Input Parameter

PL: vector row list containing NaN

Output Parameter

PL: vector row list without NaN

Examples

Shows the effect for closed polygon lines
PL=PLofCPL([PLcircle(5);NaN NaN;PLcircle(3)])
SGfigure(0,90);
CPLplot(PL,'r-',2);
CPLplot(woNaN(PL),'b-');




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, woNaN, is designed to process a vector row list, PL, which may contain NaN values. The primary goal is to remove any rows from PL that have a NaN in the first column, returning a cleaned list, NPL.

Input Parameters

Output Results

Algorithm Steps

  1. Check if the input PL is empty. If it is, return an empty NPL and exit the function.
  2. Create a logical index vector ii that identifies rows in PL where the first column is not NaN.
  3. Use this index vector ii to filter PL, creating NPL which contains only the rows without NaN in the first column.
  4. If no output arguments are specified, the function would plot the original and cleaned data for visualization, but this part is commented out in the code.

The function is useful in scenarios where NaN values are used to separate polygons in a list, and these need to be removed for further processing, such as triangulation.

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