Syntax
SG=SGbar([S,n,"col"])
Input Parameter
S : | | size [x y z]; or a set of boxes given as [x y z x n rows] |
n : | | number of edges |
"col" : | | if used 'col','r', the solid is colored |
Output Parameter
Examples
SGbar([30 20 10])
SGbar([30 20 10; 30 40 10])
Copyright 2022-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, SGbar, is part of the SG-Library and is used to create a solid geometry object without frames. It is similar to SGbox and SGseedcube but differs in the number of frames.
Input Parameters
- S: A vector specifying the size of the solid geometry in the format [x y z]. It can also be a set of boxes given as [x y z x n rows].
- n: The number of edges for the solid geometry.
- "col": An optional parameter. If specified as 'col' or 'r', the solid is colored.
Output
- SG: The resulting solid geometry object.
Algorithm Steps
- The function begins by extracting the 'col' parameter from the input arguments using the helper function
getfuncparamStr
. If 'col' is not provided, it defaults to NaN.
- The size parameter
S
is retrieved using getfuncparams
, defaulting to [30 20 10] if not specified.
- The number of edges
n
is also retrieved using getfuncparams
, defaulting to 4 if not specified.
- The function then calls
SGbox
with the input arguments to create a basic solid geometry object.
SGTremove
is called to remove frames from the solid geometry object, resulting in a bar-like structure.
- If the 'col' parameter is not NaN,
SGcolorfaces
is used to color the faces of the solid geometry.
- If no output is requested (i.e.,
nargout==0
), the function plots the solid geometry using SGfigure
and SGTplotalpha
with a transparency of 0.9.
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