CPLlinkofPL

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

returns a convex hull including budder for a list of points



See Also: PLcircleoval , CPLremstraightAmin , CPLofPLgrow , CPLbuffer

Example Illustration

 missing image of CPLlinkofPL(PL,s)

Syntax

CPL=CPLlinkofPL(PL,[s])

Input Parameter

PL: Point list
s: outer radius and inner radius [ro ri]; or default values

Output Parameter

CPL: Closed contour

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

Output

Algorithm Steps

  1. 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.
  2. 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).
  3. 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)).
  4. 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.
  5. Straight Line Removal: The function removes straight lines with a minimum angle threshold using CPLremstraightAmin with a threshold of 1e-3.
  6. 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