SGisempty

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

returns wether a solid is empty / has not faces or not

Description

necessary because of the many methods to represent solidsis

See Also: isSG

Example Illustration

 missing image of SGisempty(SG)

Syntax

ie=SGisempty(SG)

Input Parameter

SG: Solid geometry

Output Parameter

ie: true if there are no surfaces

Examples


SGdesignCutDIN912DIN985(SGtrans0(SGcylinder(15,6)),TofPez([5 0 0],[0 0 1]),[2.5 6 0],'TT',true);
SGdesignCutDIN912DIN985(SGcylinder(15,6),TofPez([5 0 0],[0 0 1]),[2.5 6 0],'TT',true); % fails




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, SGisempty, determines whether a given solid geometry (SG) is empty, meaning it has no faces or surfaces.

Input Parameters

Output Results

Algorithm Steps

  1. The function starts by converting the input SG into a standard solid geometry format using the function SGofSG(SG).
  2. It then checks if the SG is empty or if it lacks the necessary fields to define a solid geometry:
    • It checks if SG is empty using isempty(SG).
    • It checks if the field 'VL' (which likely stands for vertex list) is missing or empty using ~isfield(SG,'VL') and isempty(SG.VL).
    • It checks if the field 'FL' (which likely stands for face list) is missing or empty using ~isfield(SG,'FL') and isempty(SG.FL).
  3. If any of these conditions are true, the function sets ie to true, indicating that the solid geometry is empty.
  4. If none of these conditions are true, the function sets ie to false, indicating that the solid geometry is not empty.
Algorithm explaination created using ChatGPT on 2025-08-18 22:22. (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