SGsortfitinBB

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Surfaces
Introduced first in SolidGeometry 4.9, Creation date: 2020-01-20, Last change: 2025-09-14

returns a fits-in index list of all SG in the SG cell list

Description

In contrast to function SGsortisinsideBB, this function takes only into account the size of the bounding boxes and not the position.
The next step would be to check the collisions of all the faces if a box is crossing or inside by SGsortcollVLFLBB or
[~,~,~,~,~,~,bba]=VLDLBBofVLFL(VLA,FLA);
[~,~,~,~,~,~,bbb]=VLDLBBofVLFL(VLB,FLB);
CL=collofBBs(bba,bbb);

See Also: SGsortcollBB , SGsortisinsideBB , SGsortcollVLFLBB , VLDLBBofVLFL , collofBBs

Example Illustration

 missing image of SGsortfitinBB(BBL)

Syntax

[ELfit,iso,xsi,bsi,isi]=SGsortfitinBB(BBL)

Input Parameter

BBL: Bounding Box List or Solid Geometry cell list with n entries

Output Parameter

ELfit: Fits in pair list | It is a directed graph
iso: Neither inside nor encapsulation
xsi: inbetween , i.e. encapuslation and enclosing
bsi: encapsulating but not enclosed
isi: nothing inside

Examples


BB=rounddiv(randminv(20,3,[1 10]),2) % Create 10 Bounding boxes
SGbox(BB,'','rand'); SG=ans % Create 10 Boxes in random distance
SGsortfitinBB(SG) % Collision pair list
[a,b]=SGsortfitinBB(SG)




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

Last html export of this page out of FM database by TL: 2025-09-21