CPLcopypatternTL

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - CPL/Closed Polygon Lists
Introduced first in SolidGeometry 5.1, Creation date: 2021-02-28, Last change: 2025-09-15

copies a CPL at positions of a PL



See Also: TLofPL , CPLcirclesofPL , SGpatternRotz , CPLcopypattern , CPLcopypatternPL , SGpatternXYZ , CPLcopyradial

Example Illustration

 missing image of CPLcopypatternTL(CPL,TL,dw)

Syntax

CPLN=CPLcopypatternTL(CPL,TL,[dw])

Input Parameter

CPL: CPL to copy (nx2)
TL: array of transformation matrices such from TLofPL
dw: optional turing angle or turning array [nx1]; default is 0

Output Parameter

CPLN: Final CPL [nx2]

Examples


CPLcopypatternPL(PLcircle(1),20*rand(10,2))
CPLcopypatternPL(PLcircle(1,4),20*rand(10,2),pi/10)




Copyright 2021-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, CPLcopypatternTL, is designed to copy a Closed Polygon List (CPL) at positions defined by a Transformation List (TL). It is part of the SolidGeometry library.

Input Parameters

Output

Algorithm Steps

  1. Initialize dw to 0. If a third argument is provided and is not empty, set dw to this value.
  2. Determine the number of transformations (np) from the third dimension of TL.
  3. Calculate the number of points in CPL plus one (nc).
  4. Initialize CPLN as a matrix of NaN values with dimensions (np*nc, 2).
  5. If dw is a single value, replicate it to match the number of transformations.
  6. Iterate over each transformation index i from 0 to np-1:
  7. Remove the last row of CPLN to clean up the output.
  8. If no output is requested, plot the resulting CPLN using CPLplot with a red line style.

Example Usage

Two example calls to the function are provided:

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