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