CPLaddauxpoints

by Tim Lueth & Christina Hein, SG-Lib Toolbox: SolidGeometry 5.6 - CPL/Closed Polygon Lists
Introduced first in SolidGeometry 3.6.1, Creation date: 2017-03-27, Last change: 2025-09-14

add supporting points to embedded CPL to guarantee a specified points distance



See Also: SGofCPLzdelaunayGrid , PLFLofCPLdelaunayGrid , RLdelauxpoints , PLELaddauxpoints , RLaddauxpoints

Example Illustration

 missing image of CPLaddauxpoints(CPL,d)

Syntax

CPLN=CPLaddauxpoints(CPL,d)

Input Parameter

CPL: Closed Polygon List
d: maximum distance between two points

Output Parameter

CPLN: New Closed Polygon List

Examples


CPLaddauxpoints([PLcircle(10,6);NaN NaN; PLcircle(5,4)],1)
CPLaddauxpoints(CPLsample(12),1)




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, CPLaddauxpoints, is designed to add supporting points to a Closed Polygon List (CPL) to ensure that the distance between any two consecutive points does not exceed a specified maximum distance, d.

Input Parameters

Output

Algorithm Steps

  1. Initialize an empty list CPLN to store the new polygon points.
  2. Ensure CPL only contains the first two columns, representing x and y coordinates.
  3. Use the function separateNaN to determine the number of separate polygons within CPL by identifying NaN separators.
  4. Iterate over each separate polygon segment:
  5. Remove the last NaN NaN separator from CPLN.
  6. If no output is requested (nargout==0), plot the original and modified polygons for visual comparison:
Algorithm explaination created using ChatGPT on 2025-08-19 01:00. (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