Syntax
[SGN,C]=SGmirrorD([SG,T,D,centr])
Input Parameter
SG : | | Solid Geometry |
T : | | 'x','y','z' or T matrix |
D : | | distance in direction |
centr : | | true if result is centered; default is true |
Output Parameter
SGN : | | mirrored Solid |
C : | | Both solids combined (and centered) |
Examples
SGmirrorD(SGbox([30,2,10]),'x',19)
SGmirrorD(SGbox([30,2,10]),'y',19)
SGmirrorD(SGbox([30,2,10]),'z',19)
Copyright 2022-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, SGmirrorD
, mirrors a solid geometry in a specified direction and distance. It is part of the Solid Geometry library and was introduced in version 5.2.
Input Parameters
- SG: The solid geometry to be mirrored.
- T: The direction of mirroring, which can be 'x', 'y', 'z', or a transformation matrix.
- D: The distance in the specified direction. Default is 10 if not provided.
- centr: A boolean indicating if the result should be centered. Default is true.
Output Results
- SGN: The mirrored solid geometry.
- C: The combination of the original and mirrored solids, centered if specified.
Algorithm Steps
- Retrieve input parameters using
getfuncparams
.
- If
T
is a character, convert it to a transformation matrix using TofPez
and ezofchar
.
- Transform the solid geometry
SG
using the inverse of T
with SGtransT
.
- Calculate the maximum dimension in the 'z' direction using
zofBB
and adjust D
accordingly.
- Mirror the solid using
SGmirrorTxy
with the original transformation Torg
and adjusted distance D
.
- Combine the original and mirrored solids using
SGconcat
.
- If
centr
is true, center the combined solid using SGtrans0
.
- If no output is requested, plot the combined and original solids using
SGfigure
and SGplotalpha
.
Algorithm explaination created using ChatGPT on 2025-08-19 06: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