SGselectGroupofBBvol

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Automatic Design
Introduced first in SolidGeometry 4.7, Creation date: 2019-08-02, Last change: 2025-09-14

returns the solid ordered by volumes



See Also: SGselectGroupofT

Example Illustration

 missing image of SGselectGroupofBBvol(SGorg,gtyp)

Syntax

[SGN,SGall,vol,bb]=SGselectGroupofBBvol(SGorg,[gtyp])

Input Parameter

SGorg: Original Solid
gtyp: group method for SGanalyzePenetration

Output Parameter

SGN: largest Solid
SGall: All Solids sorted by volume of bb
vol: vol of bb
bb: bounding box

Examples


SGselectGroupofBBvol(SGsample(17))
SGselectGroupofBBvol(SGsample(17),'box')




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, SGselectGroupofBBvol, is designed to process a solid geometry object and return the largest solid based on the volume of its bounding box. It also sorts all solids by their bounding box volumes.

Input Parameters

Output Results

Algorithm Steps

  1. Retrieve the group type parameter using getfuncparams, defaulting to 'solid' if not specified.
  2. Analyze the group parts of the original solid using SGanalyzeGroupParts with the specified group type.
  3. Ensure the result is in cell format. If not, convert it to a cell array.
  4. Calculate the bounding box of the solids using BBofSG.
  5. Determine the volume of each bounding box using volofBB.
  6. Sort the volumes in descending order and rearrange the solids accordingly.
  7. Select the largest solid (first in the sorted list) and create a copy of it using SGTcopy.
  8. If no output arguments are specified, visualize the original and largest solid using SGfigure, SGplotalpha, and other plotting functions.
Algorithm explaination created using ChatGPT on 2025-08-19 00:43. (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