Syntax
SG=SGsupplement(SGA,SGB,[relpos])
Input Parameter
SGA : | | Solid A |
SGB : | | Solid B |
relpos : | | list of relative positions for SGtransrelSG |
Output Parameter
SG : | | Boolean Result of A+(B-convechullof(A)) |
Examples
SGA=SGofCPLz([PLcircle(10);nan nan;PLcircle(8)],12);
SGB=SGTremove(SGbox,'all');
SGB=SGtransrelSG(SGB,SGA,'center','right',-5)
SGsupplement(SGA,SGB);
SGtransrelSG(SGA,SGB,'supp'); % does the same
Copyright 2021-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, SGsupplement
, performs a Boolean addition of the solid parts of B that are outside of the convex hull of A. It is part of the SG-Library and was introduced in SolidGeometry 5.0.
Input Parameters
- SGA: Solid A, which is the reference solid.
- SGB: Solid B, which is the solid to be supplemented.
- relpos: A list of relative positions for the function
SGtransrelSG
. This parameter is optional and can be passed as additional arguments.
Output Results
- SG: The Boolean result of the operation A + (B - convex hull of A).
Algorithm Steps
- The function starts by appending the string 'supplement' to the list of additional arguments
varargin
.
- It then calls the function
SGtransrelSG
with the solids A and B, along with the modified list of arguments. This function performs the transformation and Boolean operation.
- If no output is requested (i.e.,
nargout == 0
), the function proceeds to visualize the result:
- It calls
SGfigure
to set up a figure window with a specified range.
- It uses
SGTplotalpha
to plot the resulting solid SG
in green.
- Commented out code suggests that it was intended to subtract the result from B and plot the difference in red, but this is not active in the current version.
Example Usage
The example provided demonstrates how to create solids A and B, transform B relative to A, and then use SGsupplement
to perform the operation. It also shows that SGtransrelSG
with the 'supp' option achieves the same result.
Algorithm explaination created using ChatGPT on 2025-08-19 06:59. (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