Syntax
SG0=SGseedcube([h])
Input Parameter
h : | | height (size) of cube); |
Output Parameter
SG0 : | | A small cube [1 x 1 x h] with one Fram 'F" at position eye(4) |
Examples
SGseedcube
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, SGseedcube
, is designed to create a small cube with a specified height and a single frame labeled 'F'. It is part of the SolidGeometry library and is used to initiate design concepts.
Input Parameters
- h: The height (or size) of the cube. If
h
is a scalar, the cube will have dimensions [1, 1, h]. If h
is a vector, it is assumed to be of the form [1, 1, h].
Output Results
- SG0: A small cube with dimensions [1 x 1 x h] and a frame 'F' positioned at the identity matrix
eye(4)
.
Algorithm Steps
- Retrieve the height parameter
h
using getfuncparams
. If h
is a scalar, set the dimensions p
to [1, 1, h]. Otherwise, assume h
is a vector and set p
to h
, with h
being the third element.
- Retrieve the frame name
N
using getfuncparams
, defaulting to 'F'.
- Create a box with dimensions
p
using SGbox
.
- Retain the frame 'F' in the box using
SGTretain
.
- Translate the box to center it at the origin using
SGtransP
with the translation vector [0, 0, -h/2].
- If the frame name
N
is not 'F', rename the frame using SGTrename
.
- If there are no output arguments, plot the cube using
SGfigure
and SGTplotalpha
with a green color.
Algorithm explaination created using ChatGPT on 2025-08-18 23:54. (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