isSG
by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - SG/Solids
Introduced first in SolidGeometry 3.9, Creation date: 2017-06-14, Last change: 2025-09-14
return whether an object is a Solid Geometry
See Also: SGisempty
, isPL
Example Illustration
Syntax
res=isSG(SG)
Input Parameter
Output Parameter
Examples
isSG(PLcircle(4))
isSG(SGofCPLz(PLcircle(4),2))
Copyright 2017-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, isSG, determines whether a given object is a Solid Geometry (SG) object. It is part of the SG-Library and was introduced in SolidGeometry version 3.9.
Input Parameters
- SG: The object to be checked if it is a Solid Geometry.
Output Results
- res: A boolean result indicating whether the object is a Solid Geometry.
Algorithm Explanation
- Initialize the result
res to false.
- Check if the object
SG has a field named 'SG'.
- If the field 'SG' exists, set
res to true.
- Check if the object
SG has a field named 'VL' and if SG.VL is not empty.
- If both conditions are met, set
res to true.
- If
SG is a cell array, recursively call isSG on the first element of the cell array SG{1}.
Example Usage
isSG(PLcircle(4)): Checks if a circle with a radius of 4 is a Solid Geometry.
isSG(SGofCPLz(PLcircle(4),2)): Checks if a Solid Geometry created from a circle with a radius of 4 and a height of 2 is a Solid Geometry.
Algorithm explaination created using ChatGPT on 2025-08-18 22:15. (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