Syntax
SG=SGofpatch([gh,fuse])
Input Parameter
gh : | | handle to patch; default is patchofgca |
fuse : | | if true; create only one SG; default is false; |
Output Parameter
SG : | | Solid Geoemtry; single or cells |
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, SGofpatch
, is designed to convert a patch object into a Solid Geometry (SG) representation. It is part of the SG-Library and was created by Tim Lueth in 2017. The function can handle multiple patches and optionally fuse them into a single SG.
Input Parameters
- gh: This is a handle to a patch object. If not provided, the function defaults to using
patchofgca
, which likely retrieves the current patch object in the graphical context.
- fuse: A boolean parameter that determines whether to fuse multiple patches into a single SG. The default value is
false
.
Output
- SG: The output is a Solid Geometry representation, which can be a single object or a cell array of objects, depending on the input and the
fuse
parameter.
Algorithm Steps
- The function checks if the first input argument is provided and not empty. If not, it defaults to
patchofgca
.
- The
fuse
parameter is set to false
by default, but can be overridden by the second input argument.
- An empty cell array
SG
is initialized with the same number of rows as gh
.
- A loop iterates over each patch in
gh
:
- For each patch, the vertices (
VL
) and faces (FL
) are extracted and stored in the corresponding cell of SG
.
- If
fuse
is true
:
- The function calls
VLFLofSG
to combine the vertices and faces of all patches into a single set.
- The
SG
variable is redefined to hold this single set of vertices and faces.
- If no output argument is specified (
nargout==0
):
- The function calls
SGfigure
and SGsurfaceplot
to visualize the SG.
Algorithm explaination created using ChatGPT on 2025-08-18 22:58. (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