SGbar

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Parametric Design
Introduced first in SolidGeometry 5.2, Creation date: 2022-05-18, Last change: 2025-09-15

returns a box without frames

Description

SGbox, SGbar and SGseedcube are very similar
SGbox has 6 frames
SGbar has no frames
SGseedcube has one "F" frame and is below the xy plane (Status of:

See Also: SGbox , SGseedcube

Example Illustration

 missing image of SGbar(S,n,

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

SG: Solid Geometry

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

Output

Algorithm Steps

  1. 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.
  2. The size parameter S is retrieved using getfuncparams, defaulting to [30 20 10] if not specified.
  3. The number of edges n is also retrieved using getfuncparams, defaulting to 4 if not specified.
  4. The function then calls SGbox with the input arguments to create a basic solid geometry object.
  5. SGTremove is called to remove frames from the solid geometry object, resulting in a bar-like structure.
  6. If the 'col' parameter is not NaN, SGcolorfaces is used to color the faces of the solid geometry.
  7. 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