CPLcopypatternPL

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - CPL/Closed Polygon Lists
Introduced first in SolidGeometry 2.7, Creation date: 2015-09-25, Last change: 2025-09-14

copies a CPL at positions of a PL



See Also: CPLcirclesofPL , SGpatternRotz , CPLcopypattern , SGpatternXYZ , CPLcopyradial , CPLcopypatternTL

Example Illustration

 missing image of CPLcopypatternPL(CPL,PL,dw)

Syntax

CPLN=CPLcopypatternPL(CPL,PL,[dw])

Input Parameter

CPL: CPL to copy (nx2)
PL: PL of relative Positions (nx2)
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 2015-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, CPLcopypatternPL, is designed to copy a Closed Polygon List (CPL) to the positions specified by a Position List (PL). It is part of the SolidGeometry library.

Input Parameters

Output Results

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 positions (np) from the size of PL.
  3. Determine the number of points in CPL (nc) and add 1 to account for closure.
  4. Initialize CPLN as a NaN-filled matrix with dimensions np*nc by 2.
  5. If dw is a single value, replicate it to match the number of positions.
  6. Loop over each position in PL:
  7. Remove the last row of CPLN to clean up the extra NaN row.
  8. If no output is requested, plot the resulting CPLN using CPLplot.
Algorithm explaination created using ChatGPT on 2025-08-19 06:56. (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