PLaddTetragridofCPL

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - PL/Point Lists
Introduced first in SolidGeometry 4.9, Creation date: 2020-02-22, Last change: 2025-09-14

returns a tetra grid point list for a bounding box or CPL



See Also: PLtetragrid

Example Illustration

 missing image of PLaddTetragridofCPL(CPL,d,w)

Syntax

PL=PLaddTetragridofCPL([CPL,d,w])

Input Parameter

CPL: CPL
d: distance of triangle grid points
w: wall distance/ default is d/3

Output Parameter

PL: Point list

Examples


PLaddTetragridofCPL(CPLsample(29),1); % Fixed Grid size of 1
PLaddTetragridofCPL(CPLsample(29)); % Automatic adjustment




Copyright 2020-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, PLaddTetragridofCPL, generates a tetra grid point list for a given closed polygon list (CPL) and is part of the SolidGeometry library. Below is a detailed explanation of the algorithm and its parameters.

Input Parameters

Output

Algorithm Steps

  1. Initialize the point list PL with NaN values and a counter k set to 0.
  2. Iterate over four levels (0 to 3) to process different sections of the CPL:
  3. Trim the PL array to remove unused NaN entries.
  4. If no output is requested, plot the CPL and the generated grid points using SGfigure, CPSplot, and PLplot.

Additional Notes

The function uses helper functions such as getfuncparams to retrieve input parameters, CPLselectinout to select sections of the CPL, and PLtetragrid to generate the grid points. The plotting functions are used for visualization if no output is specified.

Algorithm explaination created using ChatGPT on 2025-08-19 01:36. (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