SGofSG

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - SG/Solids
Introduced first in SolidGeometry 4.5, Creation date: 2019-04-06, Last change: 2025-09-14

converts cell list of solids into a solid struct

Description

exactly the same as SGofVLFL (2012), implemented just to avoid not remembering the name of the already implemented function

See Also: SGofVLFL

Example Illustration

 missing image of SGofSG(SGO)

Syntax

SG=SGofSG(SGO)

Input Parameter

SGO: cell list of structs

Output Parameter

SG: Solid struct

Examples


SG=SGbox([30,20,10])
SGofVLFL({SG,SG,SG}) % Adds even dace colors
SGcheckmeshlab(ans)

SGsample(20)
SGofSG(SGsample(20))




Copyright 2019-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, SGofSG, is designed to convert a cell list of solid structures into a single solid structure. It is part of the SG-Library and was implemented to provide a more intuitive function name for users familiar with the library.

Input Parameters

Output Results

Algorithm Steps

  1. Check if the input SGO is a cell array. If true, concatenate the cell elements into a single structure using SGconcat.
  2. If SGO is empty, return an empty structure.
  3. Convert the concatenated structure into a solid struct using SGofVLFL, which also adds even colors to the faces.
  4. Copy additional properties from the original SGO to the new solid struct using SGTcopy.
  5. If the field stampname exists in SGO, copy it to the resulting solid struct SG.
  6. If the resulting solid struct SG does not have the field VL, set SG to an empty array.
  7. If no output argument is specified, plot the solid using SGfigure and SGplot, and set the view angle to (-30, 30).
Algorithm explaination created using ChatGPT on 2025-08-19 00:46. (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