CPLconvexhulldelaunay

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

returns the convex hull for a CPL

Description

based on delaunayofCPL

See Also: CPLconvexhull , delaunayofCPL , CPLharbour , CPLfillin , CPLfillinside , CPLfillgap

Example Illustration

 missing image of CPLconvexhulldelaunay(CPL)

Syntax

CPLD=CPLconvexhulldelaunay(CPL)

Input Parameter

CPL: CPL

Output Parameter

CPLD: convex hull of the delaunay triangulation

Examples


CPLconvexhulldelaunay(CPLsample(14));
CPLconvexhulldelaunay(CPLsample(19));
CPLconvexhulldelaunay(CPLsample(21));
CPLfillgap(CPLsample(21),3)




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, CPLconvexhulldelaunay, computes the convex hull of a given Closed Polygon List (CPL) using Delaunay triangulation. Below is a detailed explanation of the algorithm and its parameters:

Input Parameters

Output Results

Algorithm Steps

  1. The function begins by calling delaunayofCPL with the first two columns of the CPL matrix. This function performs Delaunay triangulation on the 2D points provided.
  2. The output of delaunayofCPL includes a triangulation object TR2 and an edge list EL.
  3. The function CPLofPLEL is then called with the points from TR2 and the edge list EL to construct the convex hull, which is stored in CPLD.
  4. There is a commented-out line that suggests the use of CPLremstraightAmin to potentially remove straight lines or minimal angles from CPLD, but it is not executed in the current implementation.
  5. If no output is requested (i.e., nargout==0), the function proceeds to visualize the results:

The function is part of a library for handling closed polygon lists and is designed to work with other functions like CPLconvexhull, delaunayofCPL, CPLharbour, CPLfillin, CPLfillinside, and CPLfillgap.

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