SGCaddSGn

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Auxiliary function
Introduced first in SolidGeometry 1.1, Creation date: 2013-08-04, Last change: 2025-09-14

returns a SG container with n copies of a solid

Description

Auxiliary function instead of SGCaddSG

See Also: SGboxing , SGpatternXYZ , SGcopyrotZ , SGarrangeSG , SGarrangeSGC , SGCaddSG

Example Illustration

 missing image of SGCaddSGn(C,SG,n)

Syntax

C=SGCaddSGn(C,SG,n)

Input Parameter

C: Solid geometry container
SG: Solid Geometry (.VL, .FL)
n: number of copies

Output Parameter

C: Solid geometry container




Copyright 2013-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, SGCaddSGn, is designed to add multiple copies of a solid geometry to a solid geometry container. It is an auxiliary procedure from the SG-Library, specifically created to handle the addition of multiple instances of a solid geometry.

Input Parameters

Output

Algorithm Explanation

The function SGCaddSGn operates as follows:

  1. It initializes a loop that runs from 1 to n, where n is the number of copies to be added.
  2. Within each iteration of the loop, it calls another function SGCaddSG, passing the current state of the container C and the solid geometry SG as arguments.
  3. The function SGCaddSG is responsible for adding a single instance of SG to the container C.
  4. After each call to SGCaddSG, the container C is updated to include the new copy of SG.
  5. This process repeats until n copies have been added.

In summary, SGCaddSGn is a straightforward loop-based function that leverages another function to perform the actual addition of solid geometries, iterating n times to achieve the desired number of copies.

Algorithm explaination created using ChatGPT on 2025-08-18 21:51. (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