Syntax
[VL,FL]=SGgrowVLFLfi(VL,FL,fi,dt)
Input Parameter
VL : | | Vertex list |
FL : | | Facet list |
fi : | | Facet Indices |
dt : | | distance to grow |
Output Parameter
VL : | | New Vertex list |
FL : | | Same Facet list |
Examples
SGfittingsample; A=ans; FSofSGT(A,'F',-1); fi=ans;
SG=SGcolorfaces(A,'r',fi); SGfigure; view(-30,30); SGplotalpha(SG);
fi=FLofSGcolor(SG,'r');
SGgrowVLFLfi(SG.VL,SG.FL,fi,-1.5)
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, SGgrowVLFLfi
, is designed to move facets of an indexed surface along their normal vectors. It is part of the SolidGeometry library and was introduced in version 4.9. The function has not been extensively tested, so it should be used with caution.
Input Parameters
- VL: Vertex list - a matrix where each row represents the coordinates of a vertex.
- FL: Facet list - a matrix where each row represents a facet by indexing into the vertex list.
- fi: Facet indices - a vector of indices indicating which facets to move.
- dt: Distance to grow - a scalar value indicating how far to move the facets along their normal vectors.
Output Results
- VL: New vertex list - the updated list of vertices after moving the specified facets.
- FL: Same facet list - the facet list remains unchanged.
Algorithm Steps
- Calculate the normal vectors for the specified facets using the function
VLFLvertexNormal
.
- Compute the new vertex positions by adding the product of the distance
dt
and the normal vectors to the original vertex positions.
- Identify any vertices that result in
NaN
values and revert them to their original positions.
- Assign the updated vertex list to
SG.VL
and keep the facet list unchanged as SG.FL
.
- If no output is requested, visualize the original and shifted surfaces using
SGfigure
and VLFLplotalpha
functions.
Visualization
If the function is called without output arguments, it will display two subplots:
- Original: Shows the original surface with the specified facets highlighted in green.
- Surface shift: Shows the surface after the specified facets have been moved, with the moved facets highlighted in green.
Algorithm explaination created using ChatGPT on 2025-08-19 08:14. (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