CPLcopypattern

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

creates patterns by copying CPLs



See Also: CPLcopypattern , CPLcopypatternPL , SGpatternRotz , CPLcopyradial , CPLcopypatternTL

Example Illustration

 missing image of CPLcopypattern(CPL,number,delta)

Syntax

CPLN=CPLcopypattern(CPL,number,delta)

Input Parameter

CPL: Original Polygon
number: copy vector [nx ny]
delta: distance vector [dx dy]

Output Parameter

CPLN: New closed polygon line

Examples

A=CPLcopypattern;
SGofCPLz(A,40);view (-30,30);




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, CPLcopypattern, is designed to create patterns by copying closed polygon lists (CPLs). It is part of the SolidGeometry library and was introduced in version 2.4. The function takes an original polygon and generates a new pattern by replicating the polygon according to specified parameters.

Input Parameters

Output

Algorithm Steps

  1. Initialize delta to the size of the original polygon if not provided.
  2. Check the number of input arguments. If none are provided, set default values for CPL, number, and delta.
  3. If number is a scalar, convert it to a vector [number, 1].
  4. If delta is a scalar, replicate it to match the size of number.
  5. Initialize phi to 0, which is used for rotation (though not applied in this function).
  6. Start with CPLA as the original CPL.
  7. For each copy in the x-direction (from 2 to number(1)), translate the original polygon by (i-1)*delta(1) in the x-direction and append it to CPLA.
  8. Set CPLN to CPLA.
  9. For each copy in the y-direction (from 2 to number(2)), translate CPLA by (i-1)*delta(2) in the y-direction and append it to CPLN.
  10. If no output is requested, plot the resulting pattern using CPLplot and display it in a new figure.
Algorithm explaination created using ChatGPT on 2025-08-19 07: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