CPLbufferlines

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

returns all buffer contours with an repeated reduction value



See Also: CPLfindsmalldist , CPLplotbufferlines

Example Illustration

 missing image of CPLbufferlines(CPL,w)

Syntax

CPLC=CPLbufferlines([CPL,w])

Input Parameter

CPL: Closed Polygon Line
w: reduction value

Output Parameter

CPLC: Cell list with {reduction value and CPL} for all repeated values

Examples


CPLbufferlines(CPLsample(29),.5)




Copyright 2020-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, CPLbufferlines, is designed to generate buffer contours for a given closed polygon line (CPL) with a specified reduction value. It is part of the SolidGeometry library.

Input Parameters

Output

Algorithm Steps

  1. Initialize the CPL using getfuncparams to retrieve the first input parameter or use a default sample if not provided.
  2. Calculate bounding box parameters using sofBB and BBofCPL.
  3. Determine the reduction value w using getfuncparams, defaulting to a fraction of the smallest bounding box dimension if not provided.
  4. Initialize a cell array CPLC to store the results, starting with the original CPL and a reduction value of 0.
  5. Iteratively reduce the CPL using CPLbuffer with the negative of the reduction value w until the CPL becomes empty:
  6. Trim the CPLC array to remove unused cells.
  7. If no output is requested, plot the original CPL and all reduced CPLs using CPLplot and CPSplot.

Example Usage

The function can be called with a sample CPL and a reduction value, such as CPLbufferlines(CPLsample(29), 0.5), to generate and plot buffer contours.

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