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
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
- CPL: The closed polygon list for which the tetra grid is to be generated. If not provided, a default sample is used.
- d: The distance between triangle grid points. If not specified, it defaults to 0.
- w: The wall distance, which defaults to
d/3
if not provided.
Output
- PL: The resulting point list of the tetra grid.
Algorithm Steps
- Initialize the point list
PL
with NaN values and a counter k
set to 0.
- Iterate over four levels (0 to 3) to process different sections of the CPL:
- For each level, select the in/out sections of the CPL using
CPLselectinout
with parameters [2*l 2*l+1]
.
- If the selected CPL section is not empty, generate a tetra grid using
PLtetragrid
with the specified distance d
and wall distance w
.
- Append the generated grid points to
PL
and update the counter k
.
- Trim the
PL
array to remove unused NaN entries.
- 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