PLconvexhull

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - PL/Point Lists
Introduced first in SolidGeometry 1.0, Creation date: 2013-04-24, Last change: 2025-09-14

returns the convex hull of a 2D point [nx2] list

Description

This function returns the point list [nx2] of the convex hull and is an open PL. The last point and the first point are different. Points on straight lines are not removed.

See Also: PLconvexseg

Example Illustration

 missing image of PLconvexhull(PL)

Syntax

PHL=PLconvexhull(PL)

Input Parameter

PL: Single Contour Point List

Output Parameter

PHL: Convex hull point list

Examples


PLconvexhull(PLstar(10))




Copyright 2013-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, PLconvexhull, computes the convex hull of a given 2D point list, PL. The convex hull is the smallest convex boundary that encloses all the points in the list.

Input Parameters

Output Results

Algorithm Steps

  1. Create a Delaunay triangulation of the input point list PL using delaunayTriangulation.
  2. Suppress warnings related to empty triangulations using warning('off', 'MATLAB:triangulation:EmptyTri2DWarnId').
  3. Check if the triangulation connectivity list is not empty:
  4. If the connectivity list is empty, grow the line using PLgrowline with a parameter of 0.1.
  5. Restore the previous warning state.
  6. If no output is requested, plot the original point list and the convex hull using SGfigure, PLplot, and set the view to top-down with view(0,90).

Example Usage

To compute the convex hull of a star-shaped point list with 10 points, use:

PLconvexhull(PLstar(10))
Algorithm explaination created using ChatGPT on 2025-08-19 07:33. (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