Syntax
VL=VLaddz(PL)
Input Parameter
Output Parameter
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
- PL: A 2D point list with dimensions (2 x n).
- varargin: An optional parameter that can specify the z-coordinate value.
Output
- VL: A 3D vertex list with dimensions (n x 3).
Algorithm Steps
- Check if the input
PL
is empty. If it is, return an empty VL
.
- 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.
- 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
.
- If
VL
has 2 columns, append a column of the z-coordinate to make it 3D and return.
- If
VL
has 3 columns and the z-coordinate is 1, append a column of the z-coordinate for homogeneous transformation and return.
- 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