Syntax
[VL,sx,sy,sz]=VLtrans0(VL)
Input Parameter
Output Parameter
VL : | | Vertex list |
sx : | | Size in x (also maximum value in x) |
sy : | | Size in y (also maximum value in y) |
sz : | | Size in z (also maximum value in z) |
Examples
VLtrans0(rand(10,3),[5 0 0])
Copyright 2012-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, VLtrans0
, is designed to move an object represented by a vertex list (VL) to the origin of the coordinate system. The function ensures that all x, y, and z values are zero or positive.
Input Parameters
- VL: The original vertex list, which is a matrix where each row represents a vertex in 2D or 3D space.
- varargin: Optional parameters, used here to determine if the z-coordinate should be adjusted to ensure all values are positive.
Output Results
- VLN: The transformed vertex list, centered around the origin.
- sx: The size in the x-direction, also the maximum value in x.
- sy: The size in the y-direction, also the maximum value in y.
- sz: The size in the z-direction, also the maximum value in z.
Algorithm Steps
- Determine if the z-coordinate should be adjusted using
getfuncparams
with varargin
.
- Check the dimensionality of the vertex list:
- If 2D (two columns), calculate the new vertex positions by centering them around the origin. This is done by subtracting the average of the maximum and minimum values of each coordinate from each vertex.
- If 3D (three columns), calculate the size in each dimension using
sizeVL
and center the vertices similarly.
- If
z0
is true, adjust the z-coordinates to ensure all values are positive by subtracting the minimum z-value from all z-coordinates.
- If no output arguments are specified, plot the original and transformed vertex lists using
SGfigure
and CVLplot
, with annotations to distinguish between them.
Algorithm explaination created using ChatGPT on 2025-08-19 08:00. (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