SGlim

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

compresses the vertex coordinates outside a limit without changing the VL or FL

Description

This is an auxiliary to "cut" the shape of a solid by simply compressing the coordianates outside by changing the scale outside the intervall.
typically is rat 1000 to convert millimeter in micrometer but if values for ratio are < 1; we see a elongation.

See Also: SGcut

Example Illustration

 missing image of SGlim(VL,dim,lim,rat)

Syntax

VLN=SGlim(VL,[dim,lim,rat])

Input Parameter

VL: Vertex list
dim: dimension 1 2 3 ord 'x' 'y' 'z'
lim: limit max or [min max]
rat: compression ratio default is 1000;

Output Parameter

VLN:

Examples


SGgearwormDIN(1,'','',CPLmotorshaft); A=ans; view(-30,30);
SGlim(A,'y',[-18 18])
SGlim(A,'x',[-5 5])
SGlim(A,'y',[-18 18],.1)




Copyright 2018-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, SGlim, is designed to compress vertex coordinates outside a specified limit without altering the vertex list (VL) or face list (FL). It is part of the SG-Library and was introduced in SolidGeometry 4.4.

Input Parameters

Output

Algorithm Steps

  1. Retrieve input parameters using getfuncparams function, setting defaults if not provided.
  2. If lim has less than two elements, set it to [-inf, lim].
  3. Check if VL is a solid geometry object using isSG. If true, extract the vertex list from the object.
  4. Convert dim from character to numeric index if necessary.
  5. Initialize VLN as a copy of VL.
  6. For vertices with coordinates greater than lim(2) in the specified dimension, compress them using the formula: lim(2) + (coordinate - lim(2)) / rat.
  7. For vertices with coordinates less than lim(1), compress them using the formula: lim(1) + (coordinate - lim(1)) / rat.
  8. If VL was a solid geometry object, update its vertex list with VLN.
  9. If no output is requested, plot the original and modified vertex lists using SGplot or VLplot functions.
Algorithm explaination created using ChatGPT on 2025-08-19 08:26. (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