Syntax
bi=VLisInteriorofBBlist(BBL,VP)
Input Parameter
BBL : | | List of Bounding Boxes |
VP : | | Single Vertex |
Output Parameter
bi : | | bounding box index for is on bounding box or inside bounding box |
Examples
A=SGbox([30,20,10])
[~,~,~,~,~,~,BBL]=VLDLBBofVLFL(A.VL,A.FL)
VLisInteriorofBBlist(BBL,A.VL(1,:))
Copyright 2020-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, VLisInteriorofBBlist
, determines if a given vertex is inside any bounding box from a list of bounding boxes. It returns the index of the bounding box that contains the vertex.
Input Parameters
- BBL: A list of bounding boxes. Each bounding box is defined by six values representing the minimum and maximum coordinates in the x, y, and z dimensions.
- VP: A single vertex represented by its x, y, and z coordinates.
Output
- bi: A logical array indicating which bounding boxes contain the vertex. Each element corresponds to a bounding box, with a value of 1 (true) if the vertex is inside the bounding box, and 0 (false) otherwise.
Algorithm Steps
- Check if the x-coordinate of the vertex is within the x-bounds of each bounding box.
- Check if the y-coordinate of the vertex is within the y-bounds of each bounding box.
- Check if the z-coordinate of the vertex is within the z-bounds of each bounding box.
- Combine these conditions to determine if the vertex is inside each bounding box.
- If no output is requested, visualize the vertex and bounding boxes:
- Plot the vertex as a red star.
- For each bounding box, plot it with a green color if it contains the vertex, otherwise plot it in white.
Algorithm explaination created using ChatGPT on 2025-08-19 07:57. (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