patchupdateSG

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Visualization
Introduced first in SolidGeometry 2.8, Creation date: 2016-01-04, Last change: 2025-09-14

replaces an existing patch handle by updated SG

Example Illustration

 missing image of patchupdateSG(h,SG,FL)

Syntax

patchupdateSG(h,SG,[FL])

Input Parameter

h: existing patch handle
SG: Solid Geometry or VL
FL: optional Faces List




Copyright 2016-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, patchupdateSG, updates an existing patch handle with new solid geometry data. It is part of the SG-Library and was created by Tim Lueth in 2016.

Input Parameters

Algorithm Steps

  1. Initialize FL as an empty array. If a third argument is provided and is not empty, assign it to FL.
  2. Check if SG is a structure:
    • If true, perform the following:
      • Retrieve the color data from the first vertex of the existing patch handle.
      • Update the vertices of the patch handle with SG.VL.
      • Replicate the color data for each new vertex.
      • Update the faces of the patch handle with SG.FL.
    • If false, perform the following:
      • Clear the existing faces of the patch handle.
      • Update the vertices of the patch handle with SG.
      • If FL is not empty, update the faces of the patch handle with FL.
Algorithm explaination created using ChatGPT on 2025-08-18 22:18. (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