CPLcell2NaN

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - CPL/Closed Polygon Lists
Introduced first in SolidGeometry 5.4, Creation date: 2023-12-20, Last change: 2025-09-15

concatenates a cell list of CPLs into one single CPL

Description

the opposite functions are:
CPLobjects2cells
CPLregions2cell

See Also: CPLobjects2cells , CPLregions2cell , CPLbox

Example Illustration

 missing image of CPLcell2NaN(CPL)

Syntax

CPLN=CPLcell2NaN(CPL)

Input Parameter

CPL: Cell list of CPLs

Output Parameter

CPLN: CPL that is a simple concatenation of all contours in CPL

Examples


if ~exist('A') || ~exist('B') || ~exist('C') || ~exist('D') || ~exist('S') || ~exist('T')
CPLbox('','A'); A=ans; CPLbox('','B'); B=anCPLs; CPLbox('','C'); C=ans; CPLbox('','D'); D=ans;
CPLbox([10 5],'space'); S=ans; CPLbox([70 5],'table'); T=ans;
end
CPLarrange({A,B,C,S},T,'ontop',1,'add'); CPL=ans; SGfigure; CPSplot(CPL);
CPLC=CPLobjects2cells(CPL)
CPLcell2NaN(CPLC)




Copyright 2023-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, CPLcell2NaN, is designed to concatenate a cell list of closed polygon lists (CPLs) into a single CPL. It is part of the SolidGeometry library.

Input Parameters

Output Results

Algorithm Steps

  1. Check if the input CPL is a cell array. If not, return CPL as CPLN.
  2. If CPL is a cell array, initialize an empty array CPLN.
  3. Iterate over each element in the CPL cell array:
  4. Remove the first row of CPLN to eliminate the initial [NaN NaN] row.
  5. If no output argument is specified, plot the resulting CPLN using SGfigure and CPLplot.

Example Usage

The example provided in the code demonstrates how to create several CPLs using CPLbox, arrange them with CPLarrange, convert them to a cell list with CPLobjects2cells, and finally concatenate them using CPLcell2NaN.

Algorithm explaination created using ChatGPT on 2025-08-19 01:23. (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