Syntax
h=SGgethandle(SG)
Input Parameter
Output Parameter
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, SGgethandle
, is designed to return a handle to a graphical object if it is already drawn in the current axes (gca
). It is part of the SG-Library and was created by Tim Lueth on February 14, 2017. The function is primarily used for user interface purposes and does not support all types of solid geometry (SG) yet.
Input Parameters
- SG: This is the solid geometry object that contains the properties
VL
(vertices list) and FL
(faces list).
Output Results
- h: This is the handle to the graphical object if it is found; otherwise, it is an empty array.
Algorithm Steps
- Initialize the output handle
h
as an empty array.
- Use
findobj
to locate all objects of type 'patch' in the current axes (gca
), storing them in a
.
- Iterate over each object in
a
using a for-loop:
- Retrieve the vertices (
VLi
) and faces (FLi
) of the current object.
- Assign the current object to
h
.
- Check if the vertices and faces of the current object match those of the input
SG
using isequal
:
- If they match, break the loop, keeping
h
as the handle to the object.
- If they do not match, reset
h
to an empty array.
- After the loop, if
h
is not empty, set the visibility of the object to 'on' using set
.
Algorithm explaination created using ChatGPT on 2025-08-18 22:24. (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