CPLsquareline

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

creates a sequence of boxes of different x-dimensions



See Also: PLsquare , CPLstentline

Example Illustration

 missing image of CPLsquareline(x,y,d)

Syntax

[CPL,cp,d]=CPLsquareline(x,y,d)

Input Parameter

x: vector of x-dimension of squares
y: scalar y-dimension of the squares
d: distance between the squares

Output Parameter

CPL: Closed Polygon Line
cp: center points of the boxes.
d: dimensions of boxes that

Examples


CPLsquareline([1 2 3 4 5],2,1);




Copyright 2019-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, CPLsquareline, generates a sequence of boxes with varying x-dimensions, arranged in a line with specified distances between them. It is part of the SolidGeometry library.

Input Parameters

Output Results

Algorithm Steps

  1. Initialize an empty list CPL and set lx to 0. Create zero vectors ll and lm with the same length as x.
  2. Iterate over each element in x:
  3. Calculate the adjusted distances d between the midpoints of consecutive boxes.
  4. Remove the initial nan nan from CPL.
  5. Construct the center points cp as a matrix with lm as x-coordinates and zeros as y-coordinates.
  6. If no output arguments are specified, plot the CPL and center points using SGfigure, CPSplot, and PLplot.
Algorithm explaination created using ChatGPT on 2025-08-19 00:24. (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