sizeVL

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

return the size of the bounding box of a vertex list

Description

Currently the function just calucated the bounding box in this coordinate system. Later it would make sense to calucate first the eigenvektoren and to calucate the size in the objects coordinate system.
If only one output parameter is defined, the result is [xmin xmax ymin ymax zmin zmax]

See Also: , BBofVL , CPLofBB , SGofBB , VLFLofBB , BBofSG , SGsize

Example Illustration

 missing image of sizeVL(VL)

Syntax

[sx,sy,sz,mx,my,mz]=sizeVL(VL)

Input Parameter

VL: Vertex list of the object

Output Parameter

sx: size in x OR [xmin xmax ymin ymax zmin zmax]
sy: size in y
sz: size in z
mx: minimal value in x
my: minimal value in y
mz: minimal value in z




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, sizeVL, calculates the size of the bounding box of a vertex list (VL) in a 3D coordinate system. It is part of the SolidGeometry library and was introduced by Tim Lueth.

Input Parameters

Output Results

Algorithm Steps

  1. Check if VL is a structure. If so, extract the vertex list from the structure using VL=VL.VL.
  2. Check if the vertex list has only two columns. If true, add a third column of zeros to represent the z-coordinate using VL=VLaddz(VL).
  3. Calculate the minimum values for each coordinate:
    • mx = min(VL(:,1)): Minimum x-coordinate.
    • my = min(VL(:,2)): Minimum y-coordinate.
    • mz = min(VL(:,3)): Minimum z-coordinate.
  4. Calculate the size of the bounding box in each direction:
    • sx = max(VL(:,1)) - mx: Size in the x-direction.
    • sy = max(VL(:,2)) - my: Size in the y-direction.
    • sz = max(VL(:,3)) - mz: Size in the z-direction.
  5. If only one output argument is specified, return a vector containing the bounding box limits: sx = [mx, mx+sx, my, my+sy, mz, mz+sz].
Algorithm explaination created using ChatGPT on 2025-08-19 07:02. (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