VLtrans0

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Spatial Relations
Introduced first in SolidGeometry 1.0, Creation date: 2012-05-02, Last change: 2025-09-14

moves an object into the origin of the coordinate system

Description

This procedure move an object given as vertex list into coordinate system's center. All values of x,y,z are zero or positive.

See Also: VLtransT , VLtransP , VLtrans1 , VLtransR , VLtransT , VLtrans , VLtransN

Example Illustration

 missing image of VLtrans0(VL)

Syntax

[VL,sx,sy,sz]=VLtrans0(VL)

Input Parameter

VL: Original vertex list

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

Output Results

Algorithm Steps

  1. Determine if the z-coordinate should be adjusted using getfuncparams with varargin.
  2. 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.
  3. If z0 is true, adjust the z-coordinates to ensure all values are positive by subtracting the minimum z-value from all z-coordinates.
  4. 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