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
- SGorg: The original solid geometry object that is to be analyzed.
- gtyp: An optional parameter that specifies the group method for analyzing penetration. If not provided, it defaults to 'solid'.
Output Results
- SGN: The largest solid based on the bounding box volume.
- SGall: All solids sorted by the volume of their bounding boxes.
- vol: The volume of the bounding boxes.
- bb: The bounding box of the solids.
Algorithm Steps
- Retrieve the group type parameter using
getfuncparams
, defaulting to 'solid' if not specified.
- Analyze the group parts of the original solid using
SGanalyzeGroupParts
with the specified group type.
- Ensure the result is in cell format. If not, convert it to a cell array.
- Calculate the bounding box of the solids using
BBofSG
.
- Determine the volume of each bounding box using
volofBB
.
- Sort the volumes in descending order and rearrange the solids accordingly.
- Select the largest solid (first in the sorted list) and create a copy of it using
SGTcopy
.
- 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