SGTretain

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Kinematics and Frames
Introduced first in SolidGeometry 5.1, Creation date: 2022-01-15, Last change: 2025-09-15

removes frames but retains some



See Also: SGTget , SGTset , SGTplot , SGTremove , SGTui , SGTframeplot , SGTrename , SGTsetofFS

Example Illustration

 missing image of SGTretain(SG,FN2R)

Syntax

SG=SGTretain(SG,[FN2R])

Input Parameter

SG: Solid Geomnetry struct with fields 'Tname', 'T', 'FTiL'
FN2R:

Output Parameter

SG: Struct with removed frames

Examples


SGTretain(SGbox,'F','X+')
SGTrename(ans,'X+','B')




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, SGTretain, is designed to remove frames from a Solid Geometry (SG) structure while retaining specified frames. It is part of the SolidGeometry library.

Input Parameters

Output

Algorithm Steps

  1. Extract the frame names to retain from varargin and store them in FN.
  2. Use ismember to create a logical index ii that identifies which frames in SG.Tname match the names in FN.
  3. Filter the fields SG.Tname, SG.T, and SG.TFiL using the logical index ii to retain only the specified frames.
  4. If no output is requested (nargout==0), visualize the result using SGfigure and SGTplotalpha with specific parameters.

Example Usage

The example SGTretain(SGbox,'F','X+') demonstrates retaining frames 'F' and 'X+' from the SGbox structure. The subsequent call SGTrename(ans,'X+','B') renames the frame 'X+' to 'B'.

Algorithm explaination created using ChatGPT on 2025-08-18 23:29. (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