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
- CPL: A closed polygon line, which is the primary input for the function.
- w: The reduction value, which determines the amount by which the polygon is reduced in each iteration.
Output
- CPLC: A cell list containing pairs of reduction values and the corresponding reduced CPL for all iterations until the CPL becomes empty.
Algorithm Steps
- Initialize the CPL using
getfuncparams
to retrieve the first input parameter or use a default sample if not provided.
- Calculate bounding box parameters using
sofBB
and BBofCPL
.
- Determine the reduction value
w
using getfuncparams
, defaulting to a fraction of the smallest bounding box dimension if not provided.
- Initialize a cell array
CPLC
to store the results, starting with the original CPL and a reduction value of 0.
- Iteratively reduce the CPL using
CPLbuffer
with the negative of the reduction value w
until the CPL becomes empty:
- For each iteration, store the reduced CPL and its corresponding reduction value in
CPLC
.
- Trim the
CPLC
array to remove unused cells.
- 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