SGshrinktofit

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

reduces the size that the solid fits into a bounding box

Description

Simplified version of SGscale2dim
Shrinks only if it does not fit

See Also: SGgrowoutsideFS , SGgrow , SGmagnifyVL , SGscale2dim

Example Illustration

 missing image of SGshrinktofit(SG,dim)

Syntax

[SGN,k]=SGshrinktofit(SG,[dim])

Input Parameter

SG: Solid Geometry
dim: Maximum dimensions

Output Parameter

SGN: Shrinked Solid
k: shrinking factor

Examples


SGbox(1000*rand(1,3)); SG=ans;
SGshrinktofit(SG,150)
SGshrinktofit(SG,[150, 150 , 150])




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