by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Surfaces
Introduced first in SolidGeometry 5.2, Creation date: 2022-04-26, Last change: 2025-09-15
SGN=SGvaryfrom(SG,[])
SG: | Solid to be modified |
SGN: | Solid with slightly adjusted coordinates |
load ADAM_Aframes.mat;
SGvaryfrom(ADAM_Aframes) % Natural Solid ==> Most probably only a few changes
SGvaryfrom(SGbox) % Ideal geometry ==> Almost all coordinates are changed
This function, SGvaryfrom, is designed to modify a solid geometry by slightly adjusting its vertex coordinates. This adjustment helps to mitigate issues with boolean operations and numerical precision in MATLAB's 64-bit environment, particularly when using Delaunay triangulation.
SGofSG(SG), which likely creates a copy or a new instance of the solid geometry object SG. This is stored in SGN.SGN is then modified by calling VLvaryfrom(SGN.VL, varargin{:}). This function is responsible for adding small deterministic values to the vertices, effectively "jittering" them to avoid precision issues.nargout == 0), the function will plot the modified solid using SGfigure(-30,30) and SGTplotalpha(SGN). This visualization step is useful for verifying the changes made to the solid.The function can be used with different types of solid geometries:
ADAM_Aframes, the function will likely make only minor changes.SGbox, almost all coordinates may be adjusted.This function is part of a set of functions aimed at improving the robustness of geometric operations in MATLAB, particularly when dealing with complex boolean operations.
Algorithm explaination created using ChatGPT on 2025-08-19 06:53. (Please note: No guarantee for the correctness of this explanation)