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
- SG: A Solid Geometry struct with fields 'Tname', 'T', and 'FTiL'.
- varargin: A variable-length input argument list, which specifies the frame names to retain.
Output
- SG: The modified Solid Geometry struct with only the specified frames retained.
Algorithm Steps
- Extract the frame names to retain from
varargin
and store them in FN
.
- Use
ismember
to create a logical index ii
that identifies which frames in SG.Tname
match the names in FN
.
- Filter the fields
SG.Tname
, SG.T
, and SG.TFiL
using the logical index ii
to retain only the specified frames.
- 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