SGstripfields

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Auxiliary function
Introduced first in SolidGeometry 2.1, Creation date: 2015-02-20, Last change: 2025-09-14

remove fields in SG structs if they are empty, i.e. unused

Description

removes CPL,PL,EL, FC, T, Tname, TFiL

See Also: SGsample , SGTretain , retainfields

Example Illustration

 missing image of SGstripfields(SG)

Syntax

SG=SGstripfields(SG)

Input Parameter

SG: Solid Geoemtry

Output Parameter

SG: Solid Geoemtry

Examples


SG=SGsample(14)
SGstripfields(SG)




Copyright 2015-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, SGstripfields, is designed to clean up a Solid Geometry (SG) structure by removing specific fields if they are empty or unused. The function is part of the SolidGeometry library and was introduced in version 2.1.

Input Parameters

Output Results

Algorithm Steps

  1. Check if the field 'CPL' exists in the SG structure. If it does, remove it using the rmfield function.
  2. Check if the field 'PL' exists in the SG structure. If it does, remove it using the rmfield function.
  3. Check if the field 'EL' exists in the SG structure. If it does, remove it using the rmfield function.
  4. Check if the field 'FC' exists and is empty in the SG structure. If both conditions are true, remove it using the rmfield function.
  5. Check if the field 'T' exists and is empty in the SG structure. If both conditions are true, remove it using the rmfield function.
  6. Check if the field 'Tname' exists and is empty in the SG structure. If both conditions are true, remove it using the rmfield function.
  7. Check if the field 'TFiL' exists and is empty in the SG structure. If both conditions are true, remove it using the rmfield function.

Example Usage

To use this function, you can first create a sample SG structure using the SGsample function and then call SGstripfields to clean it up:

SG = SGsample(14);
SG = SGstripfields(SG);

This function is useful for maintaining a clean and efficient data structure by removing unnecessary fields, which can help in reducing memory usage and improving performance.

Algorithm explaination created using ChatGPT on 2025-08-19 00:27. (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