SGstackn

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - SG/Solids
Introduced first in SolidGeometry 1.1, Creation date: 2013-08-04, Last change: 2025-09-14

returns stacked solid geometries



See Also: SGboxing , SGpatternXYZ , SGpatternRotz , SGcopyrotZ , SGarrangeSG , SGarrangeSGC , SGCaddSGn , SGCaddSG , SGcopyVL , SGsurfaces

Example Illustration

 missing image of SGstackn(SG,n,dz)

Syntax

[SGN,h]=SGstackn(SG,n,[dz])

Input Parameter

SG: Solid geometry
n: number
dz: distance in z; default is 1mm

Output Parameter

SGN: Stacked solid geometries
h: height of stack in z

Examples


SGstackn(SGDIN433(2.5),3); % Stacking Washer for a Ball Bearing




Copyright 2013-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, SGstackn, is designed to stack solid geometries vertically along the z-axis. It is part of the SG-Library and was introduced in SolidGeometry 1.1.

Input Parameters

Output Results

Algorithm Steps

  1. Retrieve the dz parameter from varargin, defaulting to 1 if not specified.
  2. Initialize SGN with the input solid geometry SG.
  3. Calculate the bounding box BB of the solid geometry using BBofVL.
  4. Iterate from 1 to n-1 to create additional stacked geometries:
  5. Calculate the total height h of the stack as (BB(6) - BB(5)) * n + dz * (n - 1).
  6. If no output arguments are specified, plot the stacked geometries using SGfigure, SGplotsurfaces, and SGTframeplot.

Example Usage

The function can be used to stack a washer for a ball bearing three times with the following call:

SGstackn(SGDIN433(2.5), 3);
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