VILofrangez
by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - CVLz/Slices
Introduced first in SolidGeometry 2.4, Creation date: 2015-06-19, Last change: 2025-09-14
returns indices of VL and FL in a cut plane
Description
The vertex index list shows relation of the vertex z coordinate related to the cutting plane: +1 = above plane, -1 under plane, 0=crosses plane. The crossing facet list explains the crossing situation
0 0 0 All points in plane (1)
-1 -1 -1 All points under plane (1)
+1 +1 +1 All points above plane (1)
0 0 +1 One point above (3)
0 0 -1 One point under (3)
0 +1 +1 One point on plane, two above (3)
0 -1 -1 One point on plane, two under (3)
0 +1 -1 One point on plane, one above, one under (3)
0 -1 +1 One point on plane, one above, one under (3)
-1 +1 +1 One point under, one point above (3)
+1 -1 -1 One point under, one point above (3)
overall 27 combinatons
Example Illustration
Syntax
[VIL,CFL]=VILofrangez(VL,FL,z,[thr])
Input Parameter
VL: | | Vertex list |
FL: | | Facet list |
z: | | cut coordinate |
thr: | | optional grid; default is 1e-5 |
Output Parameter
VIL: | | +1 = above plane, -1 under plane, 0=crosses plane |
CFL: | | Crossing Facet List |
Examples
SG=SGbox([30 20 10]);
[a,b]=VILofrangez(SG.VL,SG.FL,5)
Copyright 2015-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, VILofrangez, determines the position of vertices and facets relative to a specified cutting plane in 3D space. It is part of the SG-Library and was created by Tim Lueth in 2015.
Input Parameters
- VL: Vertex list, a matrix where each row represents a vertex in 3D space.
- FL: Facet list, a matrix where each row represents a facet by indexing into the vertex list.
- z: The z-coordinate of the cutting plane.
- thr (optional): A threshold value for numerical precision, defaulting to 1e-5 if not provided.
Output Results
- VIL: Vertex Index List, indicating the position of each vertex relative to the cutting plane. Values are +1 (above plane), -1 (below plane), or 0 (on the plane).
- CFL: Crossing Facet List, indicating the crossing situation of each facet relative to the plane.
Algorithm Steps
- Set the threshold
thr to 1e-12 by default. If a fourth argument is provided and is not empty, use it as the threshold.
- Call the function
rounddiv on the vertex list VL with the threshold thr. This step is likely intended to adjust the precision of the vertex coordinates.
- Compute the Vertex Index List
VIL by comparing the z-coordinate of each vertex to the cutting plane coordinate z. Assign +1 if the vertex is above the plane, -1 if below, and 0 if on the plane.
- Determine the Crossing Facet List
CFL by applying the VIL values to the facets defined in FL.
Example Usage
To use this function, you can create a 3D box using the SGbox function and then determine the vertex and facet positions relative to a plane at z = 5:
SG = SGbox([30 20 10]);
[a, b] = VILofrangez(SG.VL, SG.FL, 5);
Algorithm explaination created using ChatGPT on 2025-08-19 07:17. (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