CPLarrange

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

Arranges a set of CPLS to be as widw as another one in x dimension

Description

will be extended in future

See Also: CPLcopypattern , CPLcopyradial

Example Illustration

 missing image of CPLarrange(CPLC,CPL2)

Syntax

CPLC=CPLarrange(CPLC,[CPL2])

Input Parameter

CPLC: is a cell list of CPLs
CPL2: is the dimension defining contour

Output Parameter

CPLC: Is an NAN separated CPL

Examples


CPLarrange({PLcircle(4,4), PLcircle(4,3), PLcircle(4)}, PLsquare([40 5]))




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 algorithm arranges a set of closed polygon lists (CPLs) to match the width of another CPL in the x-dimension.

Input Parameters

Output

Algorithm Steps

  1. Retrieve the dimension-defining contour CPL2 using getfuncparams. If not provided, default to PLsquare(80,5).
  2. Calculate the bounding box sz of CPL2 using BBofCPL.
  3. Calculate the bounding boxes a and b for each CPL in CPLC.
  4. Convert bounding boxes to matrices BB and cp.
  5. Calculate the width XX of each CPL and the cumulative sum DD for positioning.
  6. Determine the spacing dx between CPLs to fit within the width of CPL2.
  7. Iterate over each CPL in CPLC:
  8. Convert the cell list of CPLs to a NaN-separated format using CPLcell2NaN.
  9. If additional arguments are provided, apply a relative transformation using CPLtransrelCPL.
  10. Plot the arranged CPLs and the dimension-defining contour using CPLplot.
Algorithm explaination created using ChatGPT on 2025-08-19 08:13. (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