Syntax
VL=VLGrahamPVL(PCVL)
Input Parameter
PCVL : | | planar contour vertex list |
Output Parameter
VL : | | vertex list of the convex hull |
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 algorithm computes the convex hull for a given set of vertices that are in a plane. It is part of the SG-Library and was developed by Tim Lueth.
Input Parameters
- PCVL: Planar contour vertex list. It is a list of vertices that are assumed to be in a plane.
Output Results
- VL: Vertex list of the convex hull. This is the output of the function, representing the convex hull of the input vertices.
Algorithm Steps
- The input vertex list
PCVL
is first processed to ensure uniqueness and precision. The vertices are rounded to a precision of 1e-5 and duplicates are removed.
- The algorithm checks if there are at least three vertices. If not, it throws an error because a convex hull cannot be formed with fewer than three points.
- If exactly three vertices are present, they form a triangle, which is the convex hull, and the function returns these vertices.
- The transformation matrix
To
is calculated using the function TofPCVL
, which is used to transform the vertices.
- The vertices are transformed using
VLtransT
and the inverse of To
to ensure they lie in a plane.
- The maximum absolute value of the z-coordinates of the transformed vertices is checked. If it exceeds 0.001, an error is thrown, indicating the vertices are not coplanar.
- A Delaunay triangulation is performed on the x and y coordinates of the transformed vertices using
DelaunayTri
.
- The convex hull is computed from the Delaunay triangulation using
convexHull
, and the corresponding vertices are extracted.
- The convex hull vertices are transformed back to the original coordinate system and rounded to a precision of 1e-5.
- If no output argument is specified, the convex hull is plotted using
CVLplot
.
Algorithm explaination created using ChatGPT on 2025-08-19 00:34. (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