Syntax
SG=SGconvexhullVL(VL)
Input Parameter
Output Parameter
Examples
SGconvexhullVL(rand(1000,3))
SGconvexhullVL(SGarrow([0 0 0;100 100 100]))
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 function, SGconvexhullVL
, is designed to create the convex hull of a cloud of vertices. It is part of the SolidGeometry library and was introduced in version 4.6. The function primarily uses Delaunay triangulation to achieve this.
Input Parameters
- VL: This is the Vertex List, which can either be a list of vertices or an instance of a Solid Geometry (SG) object.
- varargin: This is a variable-length input argument list, which allows for additional parameters to be passed to the function.
Output
- SG: The output is a Solid Geometry object that contains the convex hull of the input vertex list.
Algorithm Steps
- The function begins by extracting function parameters using
getfuncparams
, with a default value of 0 if no additional parameters are provided.
- It checks if
VL
is numeric. If not, it assumes VL
is an SG object and extracts the vertex list from it.
- The vertex list is assigned to
SG.VL
.
- The convex hull is computed using Delaunay triangulation, and the resulting face list is stored in
SG.FL
.
- If the parameter
d
is greater than 0, the function calls SGgrow
to expand the geometry.
- If no output arguments are specified, the function visualizes the result using
SGfigure
and SGplot
, setting the plot light and plotting the vertex list.
Example Usage
To create a convex hull from a random set of 1000 3D points:
SGconvexhullVL(rand(1000,3))
To create a convex hull from an SG object representing an arrow:
SGconvexhullVL(SGarrow([0 0 0;100 100 100]))
Algorithm explaination created using ChatGPT on 2025-08-18 23:47. (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