Syntax
SGN=SGcopyrotZ(SG,rotangz,[tdist,n])
Input Parameter
SG : | | Solid geoemtry |
rotangz : | | list of rotation angles |
tdist : | | translation vector before each copy |
n : | | number of repeats |
Output Parameter
Examples
SGcopyrotZ(SGbox,pi/3,[100 0 0])
SGcopyrotZ(SGtrans1(SGbox([30,20,10])),[0 pi/2 pi],[25 0 10],3)
Copyright 2015-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, SGcopyrotZ, is designed to create copies of a given solid geometry (SG) by rotating it around the z-axis. The function takes several parameters to control the rotation and translation of the copies.
Input Parameters
- SG: The solid geometry to be copied and rotated.
- rotangz: A list of rotation angles in radians. Each angle specifies how much the solid should be rotated around the z-axis.
- tdist: An optional translation vector [x, y, z] that specifies how much the solid should be translated before each copy. Default is [0, 0, 0].
- n: An optional parameter specifying the number of times the solid should be repeated. Default is 1.
Output
- SGN: The resulting solid geometry after applying the specified rotations and translations.
Algorithm Steps
- Initialize the translation vector
tdist
to [0, 0, 0] if not provided.
- Initialize the number of repeats
n
to 1 if not provided.
- Initialize an empty result
SGN
.
- For each repeat (from 1 to
n
):
- Translate the solid
SG
by tdist
using SGtransP
.
- For each rotation angle in
rotangz
:
- Rotate the solid using
SGtransR
with the current angle.
- Concatenate the rotated solid to
SGN
using SGcat2
.
- If no output is requested, display the resulting solid using
SGfigure
and set the view to (-30, 30).
Algorithm explaination created using ChatGPT on 2025-08-19 01:32. (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