SGofpatch

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - SG/Solids
Introduced first in SolidGeometry 3.8, Creation date: 2017-04-19, Last change: 2025-09-14

returns a SG from a patch



See Also: patchofSG , SGplot

Example Illustration

 missing image of SGofpatch(gh,fuse)

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

Output

Algorithm Steps

  1. The function checks if the first input argument is provided and not empty. If not, it defaults to patchofgca.
  2. The fuse parameter is set to false by default, but can be overridden by the second input argument.
  3. An empty cell array SG is initialized with the same number of rows as gh.
  4. 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.
  5. 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.
  6. 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