Syntax
CPL=CPLlinkofPL(PL,[s])
Input Parameter
PL : | | Point list |
s : | | outer radius and inner radius [ro ri]; or default values |
Output Parameter
Examples
CPLlinkofPL(rand(3,2))
CPLlinkofPL(rand(3,2),0.05)
CPLlinkofPL(rand(3,2),[0.05 0.04])
CPLlinkofPL(rand(3,2),[0.05 0.01])
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 algorithm is designed to generate a closed polygon list (CPL) that represents a convex hull with a buffer for a given list of points (PL). The function is part of the SolidGeometry library and was introduced in version 4.5. Below is a detailed explanation of the algorithm and its parameters.
Input Parameters
- PL: A list of points that the algorithm will use to generate the convex hull.
- s: An optional parameter that specifies the outer and inner radii as [ro ri]. If not provided, default values are calculated based on the bounding box of the point list.
Output
- CPL: A closed contour that represents the convex hull with the specified buffer.
Algorithm Steps
- Parameter Initialization: The function begins by checking if the optional parameter 's' is provided. If not, it calculates default values based on the bounding box of the point list (PL). The default outer radius is one-tenth of the bounding box size, and the inner radius is two-thirds of the outer radius.
- Convex Hull Growth: The function calls
CPLofPLgrow
with the point list (PL) and the inner radius (s(2)) to generate an initial closed polygon list (CPL).
- Buffer Calculation: The function calculates a buffer around the convex hull using
CPLbuffer
. It first computes the convex hull of the initial CPL using CPLconvexhull
and then applies the buffer with a width of (s(1) - s(2)).
- Concatenation: The buffered convex hull (CPLC) is concatenated with the initial CPL, separated by a NaN row to indicate a break in the polygon list.
- Straight Line Removal: The function removes straight lines with a minimum angle threshold using
CPLremstraightAmin
with a threshold of 1e-3.
- Plotting (Optional): If no output is requested, the function plots the original point list (PL) and the resulting closed polygon list (CPL) using
CPLplot
and CPSplot
.
The algorithm effectively creates a buffered convex hull for a given set of points, allowing for visualization and further geometric processing.
Algorithm explaination created using ChatGPT on 2025-08-19 00:25. (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