SGTsetBFsimple
by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Kinematics and Frames
Introduced first in SolidGeometry 5.1, Creation date: 2022-02-05, Last change: 2025-09-15
adds base frame and follower frame to a solid
See Also: SGTset
, SGTsetBF
Example Illustration
Syntax
SGN=SGTsetBFsimple(SG,[PL,az])
Input Parameter
SG: | | Solid Geometry |
PL: | | xy position of centers; default is center of BB |
az: | | optional rotation |
Output Parameter
SGN: | | Solid Geometry including base frame and follower frame |
Examples
SGTsetBFsimple(SGtransP(SGsample(4),[17 23 55]))
PL=[0 0; 30 10], SGTsetBFsimple(SGofCPLz(CPLcopypatternPL(PLcircle(5),PL),5),PL)
PL=[0 0; 30 10], SGTsetBFsimple(SGofCPLz(CPLcopypatternPL(PLcircle(5),PL),5),PL,pi/3)
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, SGTsetBFsimple, is designed to add a base frame and a follower frame to a solid geometry object. It is part of the SolidGeometry library and was introduced in version 5.1.
Input Parameters
- SG: The solid geometry object to which frames will be added.
- PL: An optional parameter specifying the xy position of centers. If not provided, the default is the center of the bounding box (BB) of the solid geometry.
- az: An optional parameter for rotation. If not specified, the default is 0.
Output
- SGN: The solid geometry object including the added base frame and follower frame.
Algorithm Steps
- Retrieve the
PL and az parameters from the input arguments using getfuncparams.
- Initialize a transformation matrix
TT as an identity matrix. If az is a character, update TT using Ttransrel and reset az to 0.
- Calculate the bounding box
bb of the solid geometry SG using BBofSG.
- If
PL is empty, set it to the center of the bounding box.
- Initialize
SGN as a copy of SG.
- If
PL has only one row, add a base frame ('B') and a follower frame ('F') at the specified position and orientation using TofPez and SGTset.
- If
PL has multiple rows, iterate over each row to add corresponding base and follower frames with unique identifiers ('B1', 'F1', etc.).
- If no output is requested, plot the solid geometry with the added frames using
SGfigure and SGTplotalpha.
Algorithm explaination created using ChatGPT on 2025-08-19 07:34. (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