Syntax
SG=SGmodelMass([R])
Input Parameter
Output Parameter
Copyright 2017-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, SGmodelMass
, is designed to create a mass point with two frames using the SG-Library. It is a part of the SIMMECHANICS INTERFACE and was developed by Tim Lueth.
Input Parameters
- R: Radius of the mass point. If not provided, the default value is 1.
Output
- SG: Solid geometry object representing the mass point.
Algorithm Steps
- Initialize the radius
R
to 1. If an argument is provided and is not empty, set R
to the provided value.
- Create a sphere with radius
R
using the function SGsphere(R)
and assign it to SG
.
- Create a box with dimensions
[R*2, R*2, R*2]
using the function SGbox
and assign it to SG
.
- Set the color of the solid geometry
SG
to magenta ('m').
- Set the transformation of
SG
for frame 'B' using the function SGTset
with an identity matrix and a zero translation vector.
- Set the transformation of
SG
for frame 'F' using the function SGTset
with an identity matrix and a zero translation vector.
- If no output is expected (
nargout==0
), plot the solid geometry using SGfigure
, set the title using titleofcaller
, and view the plot from a specific angle using view(-30,30)
. Finally, plot the solid geometry with SGTplot(SG)
.
Algorithm explaination created using ChatGPT on 2025-08-18 22:36. (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