SGcopyVL

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

returns a cell list of copies or a fused Solid of SG an positions of VL



See Also: SGboxing , SGcopypatternXYZ , SGpatternRotz , SGcopyrotZ , SGarrangeSG , SGarrangeSGC , SGCaddSGn , SGCaddSG , SGstackn , SGsurfaces

Example Illustration

 missing image of SGcopyVL(SG,VL,fuse)

Syntax

SGC=SGcopyVL(SG,VL,[fuse])

Input Parameter

SG: Solid Geometry
VL: Coordiantes for creating a copy of SG
fuse: if true; SG is struct not cell; default is true

Output Parameter

SGC: cell list of SG

Examples

Create copies at ten random positions
SGcopyVL(SGbox([4,4,10]),100*rand(10,3)) % single solid with 10 closed surface
SGcopyVL(SGbox([4,4,10]),100*rand(10,3),false) % 10 separated 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, SGcopyVL, is designed to create copies of a given solid geometry (SG) at specified positions (VL) and optionally fuse them into a single solid.

Input Parameters

Output

Algorithm Steps

  1. Check if VL has two columns. If so, add a z-coordinate using VLaddz.
  2. Set the default value of fuse to true. If a third argument is provided and is not empty, update fuse with this value.
  3. Determine the number of positions, n, from the number of rows in VL.
  4. Initialize SGC as a cell array with n elements.
  5. Define constants e1 (Euler's number) and p1 (pi divided by 100).
  6. Iterate over each position in VL:
  7. If fuse is true, convert the cell array of solids into a single fused solid using VLFLofSG and clear SGC before storing the fused result.
  8. If no output is requested, plot the result using SGfigure and SGplot.
Algorithm explaination created using ChatGPT on 2025-08-19 07:44. (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