Syntax
SG=SGofVLFLSGc(SGc)
Input Parameter
SGc : | | Any kind of SG: A.SG, A{}, A.VL,A.FL |
Output Parameter
SG : | | Struct only with fields SG.Vl and SG.FL |
Examples
load JACO_robot.mat
SGofVLFLSGc(JACO)
Copyright 2018-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, SGofVLFLSGc
, is designed to extract the solid geometry from a given input structure, which can be a solid, vertex, or facet list. The function is part of the SG-Library and was introduced in SolidGeometry 4.2 by Tim Lueth.
Input Parameters
- SGc: This is the input parameter that can be any kind of solid geometry (SG). It can be a structure with a field 'SG', a cell array, or a vertex list (VL) and facet list (FL).
Output Results
- SG: The output is a structure containing only the fields
SG.VL
and SG.FL
, which represent the vertex list and facet list, respectively.
Algorithm Steps
- Check if the input
SGc
has a field 'SG'. If it does, assign SGc.SG
to SGc
.
- Initialize a cell array
SGs
to store intermediate results.
- Check if
SGc
is a cell array:
- If true, iterate over each element in
SGc
and recursively call SGofVLFLSGc
for each element. Store the results in SGs
.
- Concatenate the results in
SGs
using SGcat2
to form the final SG
.
- If
SGc
is not a cell array, call VLFLofSG
to extract the vertex list (VL) and facet list (FL) from SGc
. Assign these to SG.VL
and SG.FL
.
- If no output is requested (i.e.,
nargout == 0
), perform the following visualization steps:
- Call
SGfigure
and set the view to (-30, 30).
- If
SGc
is a cell array, iterate over each element and plot its bounding box using SGplot
and SGofBB
, with colors determined by colofn
.
- Call
VLFLplotlight
with parameters (1, 0.2) and (1, 0.5) to adjust lighting.
- Plot the final
SG
using SGplot
.
Algorithm explaination created using ChatGPT on 2025-08-19 00:39. (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