by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Spatial Relations
Introduced first in SolidGeometry 1.0, Creation date: 2013-04-23, Last change: 2025-09-14
See Also: VLswapYZ
, VLswapZY
, VLswapXY
, VLswapYX
, VLswapZX
, VLswapXZ
, VLswapX
, VLswapY
RVL=VLswapZ(VL)
VL: | Vertex list |
RVL: | Resulting vertex list |
This function, VLswapZ, is designed to mirror a list of vertices at the z-axis. It is part of the SolidGeometry library and was introduced by Tim Lueth in 2013.
The function begins by copying the input vertex list VL to the output variable RVL. This ensures that the original list is not modified during the operation.
The core operation of the function is performed in the line:
RVL=[RVL(:,1:2) -RVL(:,3) RVL(:,4:size(RVL,2))];
This line constructs a new matrix for RVL by performing the following steps:
RVL(:,1:2): This extracts the first two columns of the vertex list, which correspond to the x and y coordinates. These coordinates remain unchanged.-RVL(:,3): This negates the third column, which is the z-coordinate. This operation mirrors the vertex across the z-axis.RVL(:,4:size(RVL,2)): This extracts any additional columns beyond the third, preserving any extra data associated with each vertex.The function then returns the modified vertex list RVL, which contains the mirrored vertices.