Syntax
SG=SGofCPLzdelaunayGrid(CPL,z,[ds,dx,dy])
Input Parameter
CPL : | | Contour polygon list (CPL) |
z : | | desired height in z-coordiantes |
ds : | | delta on the contour; default is 10000 |
dx : | | delta grid in x; default is 10000 |
dy : | | delta grid in y; default is dx |
Output Parameter
Examples
SGofCPLzdelaunayGrid(CPLofPL([PLcircle(20,6);NaN NaN; flipud(PLcircle(10,4))]),10)
SGofCPLzdelaunayGrid(CPLoftext('test'),10,4,4,4)
SGofCPLzdelaunayGrid(CPLoftext('test'),10,1,1,1)
Copyright 2017-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, SGofCPLzdelaunayGrid
, generates a solid geometry from a contour polygon list (CPL) using Delaunay triangulation. It is designed to create a 3D model by tessellating the base and cover plates of a part.
Input Parameters
- CPL: A contour polygon list, which is a set of 2D points defining the shape's boundary.
- z: The desired height of the solid in the z-coordinate.
- ds: Delta on the contour, with a default value of 10000. It defines the resolution of the contour.
- dx: Delta grid in the x-direction, with a default value of 10000. It specifies the grid resolution along the x-axis.
- dy: Delta grid in the y-direction, defaulting to the value of
dx
. It specifies the grid resolution along the y-axis.
Output Results
- SG: The resulting solid geometry, represented as a structure containing vertices and faces.
Algorithm Steps
- The function begins by ensuring the CPL only contains the first two columns, which represent the x and y coordinates.
- Default values for
ds
, dx
, and dy
are set, but they can be overridden by additional input arguments.
- The CPL is corrected to ensure it is counter-clockwise using
CPLisccwcorrectedCPS
.
- The function
PLFLofCPLdelaunayGrid
is called to perform Delaunay triangulation on the CPL, generating a point list (PL) and edge list (EL).
- The function
VLFLofPLELz
is used to create the solid geometry (SG) by extruding the triangulated base to the specified height z
.
- If no output is requested, the function visualizes the solid geometry using
SGfigure
, SGtitle
, and SGplot
.
Example Usage
Examples of how to use the function include:
SGofCPLzdelaunayGrid(CPLofPL([PLcircle(20,6);NaN NaN; flipud(PLcircle(10,4))]),10)
SGofCPLzdelaunayGrid(CPLoftext('test'),10,4,4,4)
SGofCPLzdelaunayGrid(CPLoftext('test'),10,1,1,1)
Algorithm explaination created using ChatGPT on 2025-08-18 18:51. (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