Syntax
OL=outsideplaneVL(VL,p1,p2,p3)
Input Parameter
VL : | | Vertex list |
p1 : | | Point 1 of the plane |
p2 : | | Point 2 of the plane |
p3 : | | Point 3 of the plane |
Output Parameter
Examples
outsideplaneVL ([3 3 0],[0 0 0],[0 10 0],[ 10 0 0 ])
outsideplaneVL ([3 3 -1],[0 0 0],[0 10 0],[ 10 0 0 ])
outsideplaneVL ([3 3 +1],[0 0 0],[0 10 0],[ 10 0 0 ])
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, outsideplaneVL
, determines the position of vertices relative to a plane defined by three points. It returns whether each vertex in a list is below, on, or above the plane.
Input Parameters
- VL: A list of vertices. Each vertex is represented as a row in a matrix, with each row containing the x, y, and z coordinates of a vertex.
- p1: The first point defining the plane. It is a 1x3 vector representing the x, y, and z coordinates.
- p2: The second point defining the plane. It is a 1x3 vector representing the x, y, and z coordinates.
- p3: The third point defining the plane. It is a 1x3 vector representing the x, y, and z coordinates.
Output Results
- OL: A column vector where each element corresponds to a vertex in
VL
. The value is 1 if the vertex is below the plane, 0 if it is on the plane, and -1 if it is above the plane.
Algorithm Steps
- Calculate the normal vector
ez
of the plane using the cross product of vectors (p2-p1)
and (p3-p1)
.
- Determine the number of vertices
n
in the list VL
.
- Initialize the output list
OL
as a zero vector of size n
.
- For each vertex in
VL
:
- Compute the dot product of the normal vector
ez
and the vector from p1
to the vertex.
- Assign the sign of this dot product to the corresponding element in
OL
.
The function uses the cross product to find the normal vector of the plane and the dot product to determine the relative position of each vertex to the plane. The sign of the dot product indicates whether the vertex is below, on, or above the plane.
Algorithm explaination created using ChatGPT on 2025-08-19 00:09. (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