SGturn4AM

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Auxiliary function
Introduced first in SolidGeometry 5.3, Creation date: 2023-03-22, Last change: 2025-09-15

simply turns an object if the upper printing surface is larger than the lower floor printing area

Description

This functions is part of Slicers but it is easier not to think about during development and fast printing

See Also: SGwriteSTL , SGrotate

Example Illustration

 missing image of SGturn4AM(SG)

Syntax

SGN=SGturn4AM(SG)

Input Parameter

SG: Solid Geometry

Output Parameter

SGN: Turned or unchanged Solid

Examples


SGturn4AM(SGrotate(SGsample(19),'y',pi))




Copyright 2023-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, SGturn4AM, is designed to adjust the orientation of a solid object for additive manufacturing. It checks if the upper printing surface is larger than the lower floor printing area and rotates the object if necessary.

Input Parameters

Output Results

Algorithm Steps

  1. Initialize SGN as SG, assuming no change initially.
  2. Convert SG to a standard format using SGofSG.
  3. Determine the bounding box's z-dimensions using zofBB with the parameter 'bbz'.
  4. Set a tolerance value tol to 0.05 for slicing precision.
  5. Calculate the cross-sectional area slightly above the bottom using CPLofSGslice3 at zz(1) + tol.
  6. Calculate the cross-sectional area slightly below the top using CPLofSGslice3 at zz(2) - tol.
  7. Compute the areas of these cross-sections using CPLarea.
  8. Compare the areas: if the bottom area aO is greater than the top area aU, rotate the object 180 degrees around the y-axis using SGrotate.
  9. Align the rotated object to the original's center using SGtransrelSG.
  10. If no output is requested, visualize the original and potentially rotated object using SGfigure, SGplotalpha, and CVLplots.
  11. Annotate the plot to distinguish between the original and the printing orientation.
Algorithm explaination created using ChatGPT on 2025-08-19 00:49. (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