SGofCPLzdelaunayGrid

by Tim Lueth & Christina Hein, SG-Lib Toolbox: SolidGeometry 5.6 - SG/Solids
Introduced first in SolidGeometry 3.6.1, Creation date: 2017-03-27, Last change: 2025-09-14

returns a solid from a contour polygon list and grid resolution

Description

The function uses Delaunay-Triagulation to tesselate the base plate and the cover plate of the part. Therefor, make sure that there are no crossings or overlapping contours in CPL.
This function will replace SGofCPLz one day since it has the same result for the same parameter

See Also: PLFLofCPLdelaunayGrid , CPLaddauxpoints

Example Illustration

 missing image of SGofCPLzdelaunayGrid(CPL,z,ds,dx,dy)

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

SG: Solid Geometry

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

Output Results

Algorithm Steps

  1. The function begins by ensuring the CPL only contains the first two columns, which represent the x and y coordinates.
  2. Default values for ds, dx, and dy are set, but they can be overridden by additional input arguments.
  3. The CPL is corrected to ensure it is counter-clockwise using CPLisccwcorrectedCPS.
  4. The function PLFLofCPLdelaunayGrid is called to perform Delaunay triangulation on the CPL, generating a point list (PL) and edge list (EL).
  5. The function VLFLofPLELz is used to create the solid geometry (SG) by extruding the triangulated base to the specified height z.
  6. 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:

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