Syntax
SG=SGofVLFL(VL,[FL,FC,sh])
Input Parameter
VL : | | Vertex list |
FL : | | Facet list |
FC : | | Facet color |
sh : | | if true; VLFLselect is used; default is false |
Output Parameter
SG : | | Solid geometry structure |
Copyright 2012-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, SGofVLFL
, constructs a solid geometry structure from a vertex list and a facet list. It is part of the SG-Library and was developed by Tim Lueth.
Input Parameters
- VL: Vertex list, a matrix where each row represents a vertex in 3D space.
- FL: Facet list, a matrix where each row represents a facet by indexing into the vertex list.
- FC: Facet color, a matrix where each row represents the RGB color of a facet. Default is a grey color if not provided.
- sh: A boolean flag. If true, the function
VLFLselect
is used to process the vertex and facet lists. Default is false.
Output
- SG: A structure representing the solid geometry, containing fields for vertex list (VL), facet list (FL), and facet color (FC).
Algorithm Steps
- Retrieve optional parameters
FL
, FC
, and sh
using getfuncparams
.
- Check if
VL
is already a solid geometry structure using isSG
. If true, extract VL
, FL
, and FC
from it using VLFLofSG
.
- If
VL
is a structure, return an empty SG
.
- If
FC
is empty, set it to a default grey color for each facet.
- If
sh
is true, process VL
and FL
using VLFLselect
.
- If
VL
is not empty, ensure it has three columns by adding a z-coordinate if necessary using VLaddz
.
- Assign
VL
, FL
, and FC
to the SG
structure.
- If
VL
is empty, set SG
to an empty array.
- If no output is requested, plot the solid geometry using
SGfigure
and SGplot
, and set the view angle.
Algorithm explaination created using ChatGPT on 2025-08-19 01:11. (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