VLofSG

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Auxiliary function
Introduced first in SolidGeometry 3.1, Creation date: 2016-11-27, Last change: 2025-09-14

returns for nested cell solids the vertex list

Description

In constrast to write simply VL=SG.VL; this function supports nested Solids {SG1,SG2,&}

See Also: VLofgca , VLofimage , VLofVM

Example Illustration

 missing image of VLofSG(SG)

Syntax

VL=VLofSG(SG)

Input Parameter

SG: NEsted Solid Geoemtry; cells of cells of solids

Output Parameter

VL: Vertex list

Examples


A={SGsample(1), SGsample(10), SGsample(20)}
VLofSG(A)




Copyright 2016-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, VLofSG, is designed to handle nested solid geometries and extract a vertex list from them. It is part of the SG-Library and was created by Tim Lueth. The function is particularly useful for dealing with complex structures where solids are nested within cells.

Input Parameters

Output Results

Algorithm Steps

  1. The function first checks if the input SG is a cell array using iscell(SG).
  2. If SG is a cell array:
    • Initialize an empty vertex list VL=[].
    • Determine the number of elements in the cell array with n=length(SG).
    • Iterate over each element in the cell array using a for loop.
    • For each element, recursively call VLofSG(SG{i}) to extract the vertex list and concatenate it to VL.
  3. If SG is not a cell array:
    • Check if SG has a field named 'VL' using isfield(SG,'VL').
    • If the field exists, assign SG.VL to VL.
    • If the field does not exist, assign SG directly to VL.
  4. If no output argument is specified (nargout==0), the function will:
    • Call SGfigure(-30,30) to set up a figure for plotting.
    • Use VLplot(VL,'r.') to plot the vertex list in red.

This function is particularly useful for visualizing and extracting vertex data from complex nested solid structures, making it a valuable tool in the SG-Library.

Algorithm explaination created using ChatGPT on 2025-08-18 23:28. (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