Syntax
vi=VLisInteriorofBB(BB,VL)
Input Parameter
BB : | | Solid Geometry or BB |
VL : | | Vertex List |
Output Parameter
vi : | | index list for isInterior: true = isinterior |
Examples
VLisInteriorofBB(SGbox(4),(rand(1000,3)-.5)*10)
VLisInteriorofBB(SGsphere(4),(rand(1000,3)-.5)*10)
Copyright 2019-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, VLisInteriorofBB
, determines which vertices from a given list are inside a specified bounding box (BB).
Input Parameters
- BB: A bounding box or solid geometry object. It defines the 3D space within which we want to check if vertices are located.
- VL: A list of vertices, represented as a matrix where each row corresponds to a vertex with x, y, and z coordinates.
Output
- vi: A logical index list indicating which vertices are inside the bounding box. A value of
true
means the vertex is inside.
Algorithm Steps
- Check if
BB
is a solid geometry object using isSG
. If true, convert it to a bounding box using BBofSG
and store the solid geometry in SGB
.
- Round the bounding box and vertex list to a precision of 1e-6 using
rounddiv
.
- Determine which vertices are inside the bounding box by checking if each vertex's x, y, and z coordinates fall within the respective bounds of the bounding box.
- If no output is requested (
nargout==0
), visualize the results:
- Create a 3D plot with
SGfigure
and set the view angle.
- Plot the solid geometry with transparency using
SGplotalpha
.
- Plot the vertices inside the bounding box in green using
VLplot
.
Algorithm explaination created using ChatGPT on 2025-08-19 01:00. (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