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
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
- SG: The solid geometry to be copied. It is the base structure that will be replicated.
- VL: A matrix of coordinates where each row represents a position in 3D space where a copy of SG will be placed. If VL has only two columns, a z-coordinate is added using the function
VLaddz
.
- fuse: An optional boolean parameter. If true, the function returns a single fused solid structure instead of a cell array of individual copies. The default value is true.
Output
- SGC: A cell array containing the copies of SG at the specified positions. If
fuse
is true, SGC is a single fused solid structure.
Algorithm Steps
- Check if VL has two columns. If so, add a z-coordinate using
VLaddz
.
- Set the default value of
fuse
to true. If a third argument is provided and is not empty, update fuse
with this value.
- Determine the number of positions,
n
, from the number of rows in VL.
- Initialize
SGC
as a cell array with n
elements.
- Define constants
e1
(Euler's number) and p1
(pi divided by 100).
- Iterate over each position in VL:
- Display progress using
showprogress
.
- Transform SG to the current position using
SGtransP
and store it in SGC
.
- Commented out: Apply a rotation and additional transformation to SG before placing it.
- 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.
- 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