VLaddz

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Auxiliary function
Introduced first in SolidGeometry 1.0, Creation date: 2012-10-28, Last change: 2025-09-14

returns a vertex list 3D (z=0) for a point list (2D)

Description

Simple function that contains some strange behaviour for PLs
BETTER USE VL=[VL repmat(z,size(VL,1),1)]; VL=VL(:,1:3);

See Also:

Example Illustration

 missing image of VLaddz(PL)

Syntax

VL=VLaddz(PL)

Input Parameter

PL: Point list (2 x n)

Output Parameter

VL: Vertex list (n x 3)

Examples


VLaddz([1 2;3 4])




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, VLaddz, is designed to convert a 2D point list (PL) into a 3D vertex list (VL) by adding a z-coordinate. The function is part of the SG-Library and was introduced in SolidGeometry 1.0.

Input Parameters

Output

Algorithm Steps

  1. Check if the input PL is empty. If it is, return an empty VL.
  2. Initialize the z-coordinate to 0. If a second argument is provided, use its last element as the z-coordinate. If this argument is empty, throw an error.
  3. Check the dimensions of PL:
    • If PL has 2 rows and 4 or more columns, transpose it to form VL.
    • Otherwise, assign PL directly to VL.
  4. If VL has 2 columns, append a column of the z-coordinate to make it 3D and return.
  5. If VL has 3 columns and the z-coordinate is 1, append a column of the z-coordinate for homogeneous transformation and return.
  6. If no output is expected, plot the original and transformed points using SGfigure, PLplot, and VLplot.
Algorithm explaination created using ChatGPT on 2025-08-19 00:35. (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